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
{{ message }}
This repository was archived by the owner on Sep 4, 2024. It is now read-only.
**Notice:**`v-model` is required starting from `v1.1.0`, because [a lot](https://github.com/probil/v-mask/issues/16)[of](https://github.com/probil/v-mask/issues/30)[bugs](https://github.com/probil/v-mask/issues/29) with HTMLElement event listeners and sync with Vue internals.
88
88
89
89
There is no reason to support using this lib for using without `v-model` but open the door for using on [custom inputs](http://vuejs.org/v2/guide/components.html#Form-Input-Components-using-Custom-Events).
90
90
91
91
### Filter usage
92
+
93
+
The filter accepts a mask similarly to the directive, and might be useful when you need to render a raw value as masked without using an input (e.g. formatting currency).
@@ -138,7 +143,7 @@ Here is a list placeholders you can utilize by default:
138
143
139
144
140
145
### Custom placeholders
141
-
While default placeholders are easy to use and straightforward in reality we have to deal with more complex cases where validation can be a bit more complex and unpredictable. In such cases it makes sense to define custom placeholders specific to the project or the domain.
146
+
While default placeholders are easy to use and straightforward, in reality we have to deal with more complex cases where validation can be tricky and unpredictable. In such cases it makes sense to define custom placeholders specific to the project or the domain.
142
147
143
148
To define them you should pass them as an object while installing plugin. Where:
144
149
*`key` is the character in a mask
@@ -153,7 +158,7 @@ Any valid string character can be used as a placeholder (e.g. Cyrillic or Arabic
153
158
importVuefrom'vue'
154
159
importVueMaskfrom'v-mask'
155
160
156
-
Vue.use(VueMask, {
161
+
Vue.use(VueMask, {// (!) custom placeholders support requires registration as a plugin to
157
162
placeholders: {
158
163
'#':null, // passing `null` removes default placeholder, so `#` is treated as character
@@ -179,7 +186,7 @@ Entering `123456` in that input field will produce value `###-123-###-456` in `m
179
186
### Array of RegExp
180
187
In some cases you might not want to define global placeholders either because you are dealing with unique input or you are facing conflicts for placeholders in several places.
181
188
182
-
In such cases you can supply array of per-char regular excursions or static characters to `v-mask`.
189
+
In such cases you can supply array of per-char regular expressions or static characters to `v-mask`.
In this example entering `5555551234` in the input field will produce value `(555) 555-1234` in `myInputModel` variable.
206
215
207
-
**Notice**: Keep in mind that library always verifies _one_ character per regular expression. Trying verify multiple charters in the same RegExp won't work.
216
+
**Notice**: Keep in mind that library always verifies _one_ character per regular expression. Trying to verify multiple charters in the same RegExp won't work.
@@ -269,7 +280,7 @@ In this example entering `02532137` in the input field will produce valid time r
269
280
270
281
Library supports [Text Mask Addons](https://www.npmjs.com/package/text-mask-addons), they are basically pre-generated functions (describe above) for advanced functionality like currency masking.
271
282
272
-
The usage is simple. Configure the addon as want and pass the result to the `v-mask` as you would to `text-mask-core`.
283
+
The usage is simple. Configure the addon as you want and pass the result to the `v-mask` as you would to `text-mask-core`.
import createNumberMask from 'text-mask-addons/dist/createNumberMask';
@@ -293,7 +306,7 @@ Vue.use(VueMask)
293
306
});
294
307
export default {
295
308
data: () => ({
296
-
mask: currencyMask,
309
+
currencyMask,
297
310
myInputModel: ''
298
311
})
299
312
}
@@ -335,7 +348,7 @@ We're using [GitHub Releases](https://github.com/probil/v-mask/releases).
335
348
336
349
We're more than happy to see potential contributions, so don't hesitate. If you have any suggestions, ideas or problems feel free to add new [issue](https://github.com/probil/v-mask/issues), but first please make sure your question does not repeat previous ones.
337
350
338
-
**Notice:** You should make your changes only in `src` folder, don't try to edit files from `dist` as it compiled from `src` by babel and shouldn't be changes manually.
351
+
**Notice:** You should make your changes only in `src` folder, don't try to edit files from `dist` as it compiled from `src` by babel and shouldn't be changes manually. Moreover, adding a proper tests for your PR drastically improves chances of merging.
0 commit comments