fix: 断言描述修改后不生效

This commit is contained in:
chenjianxing 2020-07-22 14:54:16 +08:00
parent 451f7311bf
commit b208847cc9
1 changed files with 12 additions and 0 deletions

View File

@ -53,6 +53,15 @@
}
},
watch: {
'regex.subject'() {
this.setRegexDescription();
},
'regex.expression'() {
this.setRegexDescription();
}
},
methods: {
add: function () {
this.list.push(this.getRegex());
@ -65,6 +74,9 @@
let regex = new Regex(this.regex);
regex.description = regex.subject + " has: " + regex.expression;
return regex;
},
setRegexDescription() {
this.regex.description = this.regex.subject + " has: " + this.regex.expression;
}
}
}