• vue父子页面传值问题


    父 :

       
        
    
        
        
        
        
      
    //拒绝认领
    refuseClaim(row) {
      this.reasonId = row.id
      this.typs = row.type;
      this.showRefuseClaimIndex = true
      if (this.showRefuseClaimIndex) {
        setTimeout(() => {
          this.$refs.refuseClaimIndex.openDialog(row.type)
        }, 300)
      }
    },

    子: 

    
      
        
      
      
        
    
      
    
      
        
    
      
    
    props: {
      reasonId: '',
      types: null
    },
    data() {
      return {
        dialogVisible: false,
        dlPd:false,
        ygPd:false,
        ruleForm: {
          reason: '',
          zglszllnum: 0,
        },
        id: '',
        rules: {
          reason: [
            {required: true, message: '请填写原因', trigger: 'blur'}
          ],
          zglszllnum: [
            {required: true, message: '请填写实际载流量/功率', trigger: 'blur'}
          ]
        }
      };
    },

    changeType(){
      //判断电流还是
        if (this.types ==0){
          //显示电流
          this.dlPd = true
          this.ygPd = false
        }else if (this.types ==1){
          //显示有功
          this.dlPd = false
          this.ygPd = true
        }
    },
    openDialog(data) {
      alert(data)
      this.dialogVisible = true;
      this.changeType();
    },

    方法二:

      
    
      
      
      
      
    
    //拒绝认领
    refuseClaim(row) {
      this.reasonId = row.id
      this.formLabel = row.type==0?'实际电流':'实际功率'
      this.showRefuseClaimIndex = true
      if (this.showRefuseClaimIndex) {
        setTimeout(() => {
          this.$refs.refuseClaimIndex.openDialog()
        }, 300)
      }
    },
    
      
        
          
        
        
          
        
      
      
          确认
          取消
      
    
    props: {
      reasonId: '',
      formLabel: '',
    },

     

    openDialog() {
      this.dialogVisible = true;
    },

  • 相关阅读:
    python实现的TopologySort
    Leetcode137. 某一个数字出现一次,其余数字出现3次
    LeetCode 刷题记录——从零开始记录自己一些不会的(二)
    javascript将html中的dom元素转图片
    android 系统rc添加 shell运行脚本
    计算机专业毕业论文java毕业设计网站SSH人事管理系统|人力请假考勤工资人事奖惩[包运行成功]
    SQL中的不加锁查询 with(nolock)
    如何优雅的删除Oracle数据库中的超大表
    【C/C++内功心法】剖析预处理过程,详解其他预处理指令,提升C/C++内功
    mybatis字段映射的容错性
  • 原文地址:https://blog.csdn.net/Theshy08/article/details/126285036