2
0
mirror of https://github.com/tenrok/maska.git synced 2026-06-17 19:21:21 +03:00

#41 Fix init value on Vue 3.x

This commit is contained in:
Alexander Shabunevich
2021-10-01 17:38:24 +03:00
parent dff229f249
commit b99aacf6e0
9 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ export default class Maska {
if (this._opts.mask && (!el.dataset.mask || el.dataset.mask !== this._opts.mask)) {
el.dataset.mask = this._opts.mask
}
this.updateValue(el)
setTimeout(() => this.updateValue(el), 0)
if (!el.dataset.maskInited) {
el.dataset.maskInited = true
el.addEventListener('input', evt => this.updateValue(evt.target, evt))