forked from vue-generators/vue-form-generator
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfieldMasked.vue
30 lines (25 loc) · 859 Bytes
/
fieldMasked.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<template lang="jade">
input.form-control(type="text", v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled", :placeholder="schema.placeholder", :readonly="schema.readonly", :name="schema.inputName")
</template>
<script>
/* global $ */
import abstractField from "../abstractField";
export default {
mixins: [ abstractField ],
mounted() {
this.$nextTick(function () {
if (window.$ && window.$.fn.mask) {
$(this.$el).unmask().mask(this.schema.mask, this.schema.maskOptions);
} else {
console.warn("JQuery MaskedInput library is missing. Please download from https://github.com/digitalBush/jquery.maskedinput and load the script in the HTML head section!");
}
});
},
beforeDestroy() {
if (window.$ && window.$.fn.mask)
$(this.$el).unmask();
}
};
</script>
<style lang="sass">
</style>