now there is a requirement to determine which items are required based on the user"s different choices.
my idea is to globally give a variable of required: true, and then listen to the user"s selection in watch, dynamically change the value of required,
name: [
{ required: this.required, message: "", trigger: "blur" },
],
name2: [
{ required: true, message: "", trigger: "blur" },
],
required judges according to the value of this.required, but this doesn"t seem to work, and then I change my verification thinking
name: [
{ required: true }, {
validator: (rule, value, callback) => {
if (this.ruleForm.visitDateType == 1) {
}
}
}
]