vue动态实现form表单的必填项校验

代码

<el-form-item label="对方物料" prop="receiptMaterialId" :rules="form.receiptPaymentType === '01'||form.receiptPaymentType === '05' ? [{required: false}]:rules.receiptMaterialId">

rules: {
          receiptMaterialId: [
            {required: true, message: '对方物料不能为空', trigger: 'blur'}
          ]
}
Logo

前往低代码交流专区

更多推荐