Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
vue-text-mask
Advanced tools
First, install it.
npm i vue-text-mask --save
Then, use it as follows:
<template>
<div>
<label>Phone Number</label>
<masked-input
type="text"
name="phone"
class="form-control"
v-model="phone"
:mask="['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]"
:guide="false"
placeholderChar="#">
</masked-input>
</div>
</template>
<script>
import MaskedInput from 'vue-text-mask'
export default {
name: 'name',
components: {
MaskedInput
},
data () {
return {
phone: ''
}
}
}
</script>
You could alternatively define the component globally:
import Vue from 'vue'
import MaskedInput from 'vue-text-mask'
Vue.component('masked-input', MaskedInput);
<masked-input>
is essentially a wrapped <input>
element - so it supports all the regular input properties (type, placeholder, class, etc). It is compatible with v-model 2-way binding, and is reactive to changes to any of the text mask props.
For more information about the props
that you can pass to the component, see
the documentation here.
To see an example of the code running, follow these steps:
git clone git@github.com:text-mask/text-mask.git
npm install
npm run vue:dev
We would love some contributions! Check out this document to get started.
FAQs
Vue component for input masking
The npm package vue-text-mask receives a total of 12,020 weekly downloads. As such, vue-text-mask popularity was classified as popular.
We found that vue-text-mask demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.