Skip to content

Commit 69bcf99

Browse files
committed
refactor(validator): model value watch use sync
1 parent e60ee69 commit 69bcf99

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/components/validator/validator.vue

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,18 @@
104104
value(newVal) {
105105
this.valid = newVal
106106
},
107-
targetModel() {
108-
if (this.isDisabled) {
109-
return
110-
}
111-
if (!this.dirty) {
112-
this.dirty = true
113-
}
107+
targetModel: {
108+
handler() {
109+
if (this.isDisabled) {
110+
return
111+
}
112+
if (!this.dirty) {
113+
this.dirty = true
114+
}
114115
115-
this.validate()
116+
this.validate()
117+
},
118+
sync: true
116119
},
117120
isDisabled(newVal) {
118121
if (!newVal && this.trigger && !this.validated) {

0 commit comments

Comments
 (0)