2
0
mirror of https://github.com/tenrok/maska.git synced 2026-05-15 11:59:38 +03:00

Added reactivity to vue mask

This commit is contained in:
Alexander Shabunevich
2020-02-01 17:00:03 +03:00
parent a969eb4942
commit d3a7c0eee9
4 changed files with 21 additions and 11 deletions
+14
View File
@@ -29,6 +29,13 @@
</div>
<p class="help is-family-code">v-maska="['+1 (###) ##-##-##', '+1 (###) ###-##-##']"</p>
</div>
<div class="field">
<label class="label">Reactive mask: <input type="checkbox" v-model="dotFormat"> use dot as date separator?</label>
<div class="control">
<input v-maska="dateMask" class="input">
</div>
<p class="help is-family-code">v-maska="dateMask" — reactive mask by `dateMask` computed property</p>
</div>
<div class="field">
<label class="label">Hex color (custom tokens): {{ color }}</label>
<div class="control">
@@ -118,7 +125,14 @@
el: '#vue-form',
data: {
phone: '19992345678',
dotFormat: false,
color: null
},
computed: {
dateMask: function() {
return this.dotFormat ? '##.##.####' : '##/##/####'
}
}
});