text-mask-collection

1.5.0 • Public • Published

text-mask-collection

Travis Code Climate Code Climate

Repository of pre-made input masks

To be used with text-mask with support for Vanilla, Vue, Angular, React and more.

Usage with Vue

The plugin exposes three properties $mask, $unmask and $format with functions mask/unmask and transform according each respective mask.

import Vue from 'vue';
import {VueTextMasks} from 'text-mask-collection';
import VueTextMask from 'vue-text-mask';
 
Vue.use(VueTextMasks);
 
Vue.component('m-input', VueTextMask);
 
new Vue({
  template: `
  <div>Value: {{$format.centimeters(rawValue)}}</div>
  <m-input
    :value="rawValue"
    :mask="$mask.centimeters"
    @input="rawValue = $unmask.centimeters($event) />
  `,
  data() {
    return {rawValue: 100}
  },
});

/text-mask-collection/

    Package Sidebar

    Install

    npm i text-mask-collection

    Weekly Downloads

    1

    Version

    1.5.0

    License

    MIT

    Unpacked Size

    28.6 kB

    Total Files

    5

    Last publish

    Collaborators

    • victorotavio
    • incuca.tech