• 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;
    },

  • 相关阅读:
    大批量合并识别成一个表或文档的方法
    一行代码“黑”掉任意网站
    JavaScript 进阶03
    Simulink 自动代码生成:手写代码替换生成代码Code Replacement Tool使用
    赤霉素3β-羟化酶的下调增强了大豆的光合作用并提高了种子产量
    【LeetCode】70. 爬楼梯
    基于SSM开发在线学习网站(前台+后台)
    React报错之No duplicate props allowed
    Webpack 5 超详细解读(四)
    Java集合框架面试指南
  • 原文地址:https://blog.csdn.net/Theshy08/article/details/126285036