Gathering detailed insights and metrics for vue-imask-vue-2.7
Gathering detailed insights and metrics for vue-imask-vue-2.7
Gathering detailed insights and metrics for vue-imask-vue-2.7
Gathering detailed insights and metrics for vue-imask-vue-2.7
npm install vue-imask-vue-2.7
Typescript
Module System
Node Version
NPM Version
54.9
Supply Chain
97.2
Quality
74.8
Maintenance
50
Vulnerability
100
License
TypeScript (93.31%)
JavaScript (3.67%)
HTML (2.96%)
Ruby (0.05%)
Total Downloads
3,353
Last Day
2
Last Week
19
Last Month
70
Last Year
1,145
5,011 Stars
956 Commits
262 Forks
30 Watching
9 Branches
29 Contributors
Minified
Minified + Gzipped
Latest Version
6.4.3
Package Id
vue-imask-vue-2.7@6.4.3
Unpacked Size
59.27 kB
Size
14.56 kB
File Count
14
NPM Version
8.6.0
Node Version
16.14.2
Cumulative downloads
Total Downloads
Last day
-60%
2
Compared to previous day
Last week
-38.7%
19
Compared to previous week
Last month
-44.4%
70
Compared to previous month
Last year
-23.6%
1,145
Compared to previous year
vue-imask
This fork is for personal use (be compatible with Vue 2.7 that does not require @vue/composition-api package)
I updated "vue-demi" package as stated in Vue 2.7
npm i vue-imask
for Vue 2 also do:
npm i -D @vue/composition-api
If you are using NuxtJS with Vue 2 you also need to install:
npm i -D @nuxtjs/composition-api
And then add @nuxtjs/composition-api/module
in the buildModules option in your nuxt.config.js
.
1<template> 2 <imask-input 3 v-model="numberModel" 4 :mask="Number" 5 radix="." 6 :unmask="true" 7 <!-- depending on prop above first argument of 'accept' callback is 8 `value` if `unmask=false`, 9 `unmaskedValue` if `unmask=true`, 10 `typedValue` if `unmask='typed'` --> 11 @accept="onAccept" 12 13 <!-- ...see more mask props in a guide --> 14 15 <!-- other input props --> 16 placeholder='Enter number here' 17 /> 18</template> 19 20<script> 21 import { IMaskComponent } from 'vue-imask'; 22 23 export default { 24 data () { 25 return { 26 numberModel: '', 27 onAccept (value) { 28 console.log(value); 29 } 30 } 31 }, 32 components: { 33 'imask-input': IMaskComponent 34 } 35 } 36</script>
1<template> 2 <imask-input 3 <!-- possible to use 'v-model' = 'v-model:value' = 'v-model:masked' and 'v-model:unmasked' --> 4 v-model:typed="numberModel" 5 :mask="Number" 6 radix="." 7 @accept:masked="onAccept" <!-- accept value (same as '@accept:value' or just '@accept') --> 8 @accept:unmasked="onAcceptUnmasked" 9 <!-- 10 @accept:typed="onAccepttyped" 11 @complete:typed="onCompleteTyped" 12 --> 13 14 <!-- ...see more mask props in a guide --> 15 16 <!-- other input props --> 17 placeholder='Enter number here' 18 /> 19</template> 20 21<script> 22 import { IMaskComponent } from 'vue-imask'; 23 24 export default { 25 data () { 26 return { 27 numberModel: '', 28 onAccept (value) { 29 console.log({ value }); 30 }, 31 onAcceptUnmasked (unmaskedValue) { 32 console.log({ unmaskedValue }); 33 } 34 } 35 }, 36 components: { 37 'imask-input': IMaskComponent 38 } 39 } 40</script>
In some cases value bindings (v-model
) might not work for directive, you can use @accept
or @complete
events to update the value.
1<template> 2 <input 3 :value="value" 4 v-imask="mask" 5 @accept="onAccept" 6 @complete="onComplete"> 7</template> 8 9<script> 10 import { IMaskDirective } from 'vue-imask'; 11 12 export default { 13 data () { 14 return { 15 value: '', 16 mask: { 17 mask: '{8}000000', 18 lazy: false 19 }, 20 }, 21 }, 22 methods: { 23 onAccept (e) { 24 const maskRef = e.detail; 25 this.value = maskRef.value; 26 console.log('accept', maskRef.value); 27 }, 28 onComplete (e) { 29 const maskRef = e.detail; 30 console.log('complete', maskRef.unmaskedValue); 31 }, 32 }, 33 directives: { 34 imask: IMaskDirective 35 } 36 } 37</script>
More options see in a guide.
1<template> 2 <input ref="el"> 3</template> 4 5<script> 6 import { useIMask } from 'vue-imask'; 7 8 export default { 9 setup (props) { 10 const { el, masked } = useIMask({ 11 mask: Number, 12 radix: '.', 13 }); 14 15 return { el }; 16 } 17 } 18</script>
No vulnerabilities found.
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 2/27 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
31 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More