You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-4Lines changed: 24 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,15 +84,35 @@ See the [token source file](https://github.com/RonaldJerez/vue-input-facade/blob
84
84
<inputtype="text"v-facade="'##/##/##'" />
85
85
```
86
86
87
-
See [demo page](https://ronaldjerez.github.io/vue-input-facade) for more usage examples
87
+
### Migrating existing projects
88
88
89
-
## Thanks
89
+
If you are migrating an existing project to vue-input-facade from another plugin and dont want to touch the whole codebase. You may pass options during plugin installation to override the default tokens or directive name.
90
90
91
-
Thanks to [Marcos Neves](https://vuejs-tips.github.io/) for the vue-the-mask component of which this vue-input-facade was originally forked from.
91
+
```javascript
92
+
importInputFacadefrom'vue-input-facade'
93
+
94
+
// migrating from v-mask
95
+
constoptions= {
96
+
// rename the directive from: v-facade to: v-mask
97
+
name:'mask',
98
+
99
+
// use these tokens instead of the default
100
+
tokens: {
101
+
'#': { pattern:/\d/ },
102
+
'A': { pattern:/[a-z]/i },
103
+
'N': { pattern:/[0-9a-z]/i },
104
+
'X': { pattern:/./ }
105
+
}
106
+
}
107
+
108
+
Vue.use(InputFacade, options)
109
+
```
110
+
111
+
See [demo page](https://ronaldjerez.github.io/vue-input-facade) for more usage examples
92
112
93
113
## Contribution
94
114
95
-
You're free to contribute to this project by submitting Issues and/or pull requests. This project is test-driven, so keep in mind that every change and new feature should be covered by tests.
115
+
You're free to contribute to this project by submitting issues and/or pull requests. This project is test-driven, so keep in mind that every change and new feature should be covered by tests. The project uses [semantic-release](https://github.com/semantic-release/semantic-release) to release new versions, therefore all commit messages should follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary), we are using [commitizen](https://github.com/commitizen/cz-cli) to facilitate writting the commit messages.
Returning a boolean `true` will leave the masked or unmasked value as is, the value is passed by reference so if you modify them here, that will be their final value. However if a `false` is returned, the user's input will be ignored and the value will remain as it was prior.
Copy file name to clipboardExpand all lines: docs/directive.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
-
For times when you cannot use the component, you may use the directive instead. The directive has all the same features as the component, however the interface may not be as straight forward as using a component.
1
+
For times when you cannot use the component, you may use the directive instead. The directive has all the same features as the component, however the interface may not be as straight forward as using a component. The `prefill` and `short` features may passed in to the directive as modifiers.
You have access to the unmasked value via the input event. The `unmaskedValue` property can be found as part of the `target` property of the input event.
18
18
19
+
> Note: Some 3rd party components may not pass the `event` parameter when emitting input, such is the case with vuetify's v-text-input. In this case you can listen to the native event so you can still access the unmasked value. ex: `v-on:input.native="handler"`.
0 commit comments