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

  • 相关阅读:
    gradle 改为 国内镜像 下载
    cs客户端测试注意点
    Linux系统中线程同步方式中的条件变量操作方法
    新概念英语(第二册)复习——Lesson 16 - Lesson20
    javaWebssh票据管理系统myeclipse开发mysql数据库MVC模式java编程计算机网页设计
    原三高搜索条件-多选问题
    C到C++的敲门砖-1
    卷积核、特征图可视化
    楠姐技术漫话:图计算的那些事 | 京东云技术团队
    mybatis ORDER BY FIND_IN_SET 失效的一次问题排查
  • 原文地址:https://blog.csdn.net/Theshy08/article/details/126285036