listen for a field in the form form in watch and pop up a warning. Did not report wrong before, I do not know what reason suddenly there is such a warning, write a vue project, do not understand the reason, have encountered or know the god to help guide, thank you!
Code:
watch: {
// 1518
"form.sfzhm": function (val) {
if (val.length === 15) {
this.form.sfzhm = cardExchangeIsValid(val);
} else if (val.length === 18) {
const flag = val.charAt(val.length - 2) % 2 === 0;
const birth = `${val.substring(6, 10)}-${val.substring(10, 12)}-${val.substring(12, 14)}`;
this.form.xb = flag ? "2" : "1";
this.form.csrq = birth;
// this.getHjszd();
}
}
warning screenshot: