vue-imask-fork

    5.2.1 • Public • Published

    Vue IMask Plugin

    vue-imask

    npm version License: MIT

    Install

    npm install vue-imask

    Mask Component Example

    <template>
      <imask-input
        v-model="numberModel"
        :mask="Number"
        radix="."
        :unmask="true"
        // depending on prop above first argument is
        // `valueif `unmask=false`,
        // `unmaskedValueif `unmask=true`,
        // `typedValueif `unmask='typed'`
        @accept="onAccept"
        // ...and more mask props in a guide
     
        // other input props
        placeholder='Enter number here'
      />
    </template>
     
    <script>
      import {IMaskComponent} from 'vue-imask';
     
      export default {
        data () {
          return {
            numberModel: '',
            onAccept (value) {
              console.log(value);
            }
          }
        },
        components: {
          'imask-input': IMaskComponent
        }
      }
    </script> 

    Mask Directive Example

    <template>
      <input
        :value="value"
        v-imask="mask"
        @accept="onAccept"
        @complete="onComplete">
    </template>
     
    <script>
      import {IMaskDirective} from 'vue-imask';
     
      export default {
        data () {
          return {
            value: '',
            mask: {
              mask: '{8}000000',
              lazy: false
            },
            onAccept (e) {
              const maskRef = e.detail;
              console.log('accept', maskRef.value);
            },
            onComplete (e) {
              const maskRef = e.detail;
              console.log('complete', maskRef.unmaskedValue);
            }
          }
        },
        directives: {
          imask: IMaskDirective
        }
      }
    </script> 

    More options see in a guide.

    Many Thanks to

    @Yegor Loginov

    @Stanislav Eremenko

    @Yacine Hmito

    @unofficial

    Support Development

    Paypal

    Install

    npm i vue-imask-fork

    DownloadsWeekly Downloads

    0

    Version

    5.2.1

    License

    MIT

    Unpacked Size

    22 kB

    Total Files

    5

    Last publish

    Collaborators

    • davronsherbaev