Skip to content

🛡 Vue directive to restrict an input by unicode values

License

Notifications You must be signed in to change notification settings

ndelvalle/v-unicode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

v-unicode

Codeship Status for ndelvalle/v-unicode Coverage Status dependencies Status devDependencies Status Codacy Badge

Vue directive to restrict an input by unicode values. It allows the input to be used just with the defined unicodes. It also sanitizes the value when invalid unicodes are being paste into the input.

Install

$ npm install --save v-unicode
$ yarn add v-unicode

Use

import Vue from 'vue'
import vUnicode from 'v-unicode'

Vue.use(vUnicode)
<template>
  <!--  Allow only numeric values  -->
  <input type="text" v-unicode="{ from: 48, to: 57 }">
  <input type="text" v-unicode="[48, 49, 50, 51, 52, 53, 54, 55, 56, 57]">
</template>

License

MIT License

Style

Standard - JavaScript Style Guide

About

🛡 Vue directive to restrict an input by unicode values

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published