A vue input component that only allows input based on a passing regex
npm install vue-regex-input
<vue-regex-input class="some-class"
:regExp="/^\d*(\.\d{0,2})?$/g" //match alphanumerics
@input="handleInput"
@change="handleChange"
v-model="val">
</vue-regex-input>
As this project uses the newer vue-loader v13+ you need to import the module in a slightly different way. https://github.com/vuejs/vue-loader/releases/tag/v13.0.0
// before
const Foo = require('./Foo.vue')
// after
const Foo = require('./Foo.vue').default
// alternatively just use the ES6 module style
import vSelect from 'vue-regex-input';
Vue.component( 'vue-regex-input', vSelect );
To build the library:
npm run build
To build the basic demo:
npm run demo
To start the dev page with hot reloading
npm run dev
To run all tests
npm test
To generate doc file based on jsdoc
npm run jsdoc
coverage threashold is defined in the root package.json. Default test task will check the coverage.