cd-adc-pattern-input
A Vue2.0 Component used RegExp to limit the user's input, and works like native input element.
Table of contents
Demo build setup
# install dependenciesnpm installorcnpm install# serve with hot reload at localhost:8080npm run dev# build for production with minificationnpm run build# build for production and view the bundle analyzer reportnpm run build --report
For detailed explanation on how things work, checkout the guide and docs for vue-loader.
Live demo
Just click there: Live Demo.
What's included
Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:
cd-adc-pattern-input/
├── ...
├── src/
│ ├── /component
│ │ └── pattern-input.vue
│ └── /js
│ └── ... demo ...
└── /view
└── demo.html
Quick start
Parameter declaration
/** * Component Settings * @param * @param * @param * @param {String\Number} val For v-model * @return */
Vue script
setting: pattern: '^[0\\D]*|\\D*' // Match string that doen't belong to the positive integer flags: 'g' replacement: '' val: '223'
Vue template
This setting will make user input positive integer only.
Bugs and feature requests
Have a bug or a feature request? If your problem or idea is not addressed yet, please open a new issue.
License
Code released under the MIT License.