vue表单里面嵌套表格,并对表格里面的内容进行表单验证

      
        
          
            
          
          
            
          
          
            
          
          
            
          
          
            
          
        
      


data(){

    return{
// 表单绑定的对应的数据
formPriceAllocation: {

        cardPriceAllocation: [
          {
            customerLevel: '', // 客户等级
            gradeValue: '', // 等级值
            allList: [
              {
                allocationListStartTime: '', // 生效开始时间
                allocationListEndTime: '', // 生效结束时间
                allocationListPrice: '' // 价格
              }
            ]
          }
        ]

      },
    // 表单绑定的规则校验 
      rules: {
        customerLevel: [
          {
            required: true,
            validator: priseCustomerLevelRules,
            trigger: ['blur']
          }
        ],
        gradeValue: [
          {
            required: true,
            validator: priseGradeValueRules,
            trigger: ['blur']
          }
        ],
        allocationListStartTime: [
          { required: true, validator: priseStartTimeRules, trigger: ['blur', 'change'] }
        ],
        allocationListEndTime: [
          { required: true, validator: priseEndTimeRules, trigger: ['blur'] }
        ],
        allocationListPrice: [
          { required: true, validator: priseRules, trigger: 'blur' }
        ]
      },

    }

   }
      

你可能感兴趣的:(vue.js,elementui,javascript)