https://github.com/scrum/vue-restricted-input
Input mask library for vue.js based on credit-card-input-mask
https://github.com/scrum/vue-restricted-input
Last synced: about 1 year ago
JSON representation
Input mask library for vue.js based on credit-card-input-mask
- Host: GitHub
- URL: https://github.com/scrum/vue-restricted-input
- Owner: Scrum
- License: mit
- Created: 2019-05-21T14:03:45.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T05:35:51.000Z (over 3 years ago)
- Last Synced: 2025-02-21T09:57:37.152Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 925 KB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- Funding: .github/funding.yml
- License: license
Awesome Lists containing this project
README
# vue-restricted-input
> Input mask for vue.js based on [credit-card-input-mask](https://github.com/Scrum/credit-card-input-mask)
[](https://vuejs.org/)[]()[](https://www.npmjs.com/package/vue-restricted-input)[](https://github.com/sindresorhus/xo)[](https://coveralls.io/r/Scrum/vue-restricted-input)
[](https://www.npmjs.com/package/vue-restricted-input)[](https://www.npmjs.com/package/vue-restricted-input)
## Why ?
[credit-card-input-mask](https://github.com/Scrum/credit-card-input-mask) perfect work with carriage position, fast.
## Install
```bash
$ npm install vue-restricted-input
```
> **Note:** This project is compatible with node v12+
## Usage
***`main.ts`***
```javascript
import { createApp } from 'vue';
import {VueRestrictedInputDirective} from 'vue-restricted-input';
import App from './App.vue';
const app = createApp(App);
app.directive('mask', VueRestrictedInputDirective);
```
***`App.vue`***
```vue
import {ref} from 'vue';
const value = ref('11111111');
const mask = ref('{{9999}} {{9999}}');
```
## Related
- [credit-card-input-mask](https://github.com/Scrum/credit-card-input-mask) - Allow restricted character sets in `input` elements.