<el-form-item prop="test2">
<el-select v-model="form.discountId" :disabled="!(form.discount === 3)">
<el-option v-for="item in discountschema"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
const validateTest = (rule,value,callback) => {
if (!(this.discount === 3)) {
callback();
}
else {
console.log("dsafsaf");
this.discountschema.map(item =>{
if (!item.discountId){
callback(new Error("fasdfadf"));
}
});
}
};
test2: [
{validator: validateTest, required: true, trigger: "blur"}
],
write a check to a select if the select is not selected and worth it, you need to be prompted, but the check is not performed. I don"t know where the problem