1.0.5 • Published 4 years ago

vvv-type v1.0.5

Weekly downloads
5
License
ISC
Repository
-
Last release
4 years ago

Vue input type

Install

yarn add vvv-type 
npm i -S vvv-type 

Local (as directive)

import typeMask from 'vvv-type';

export default function (el, binding) {
  typeMask(el, binding);
}

Example

  <input 
    v-model="field"
    v-type="{
      name: 'float',
      maxLength: 5
    }"
  />

Default types

'float': /^\d*\.?\d*/
'number': /\d*/
'word': /[A-zА-я]*\s?/g
'ruWord': /[А-я]\s*/g
'enWord': /[А-я]\s*/g

Custom types

import typeMask from 'vvv-type';

const customTypes = {
  'float': /^\d*\.?\d*/,
  'number': /\d*/,
  'any': /.*/,
  'lowCase': /[а-я]/g
}
export default function (el, binding) {
  typeMask(el, binding, customTypes);
}
1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.0

4 years ago