業務需求:
ruleForm.commodityType 為下拉框
選擇 commodityType 點擊確定 會校驗 校驗為空 出現提示語
再選擇 commodityType 為新值 校驗出現上一次 的
所以要清空提示語
watch:{ 'ruleForm.commodityType' (newValue) { if (newValue && newValue=== '1') { this.$refs['ruleForm'].clearValidate(['commodityName']); } else if (newValue && newValue=== '0') { this.$refs['ruleForm'].clearValidate(['commodityFictitiousId']); } } },