1.0.51 • Published 3 years ago
vue-pwd-input v1.0.51
vue-pwd-input
vue 密码输入框插件| a password plugin
How to use
install
npm install --save vue-pwd-input
main.js/xxx.vue
import Vue from "vue";
import PwdInput from "vue-pwd-input";
Vue.use(PwdInput);
xxx.vue
<template>
<pwd-input :max-length="6" ref="pwd" @blur="pwdBlur" @listenInput="listenInput"></pwd-input>
</template>
<script>
data () {
return {
password: ''
}
},
methods: {
pwdBlur (password) {
this.password = password // get input password
},
listenInput (val) {
console.log(val) // get input password
},
pwdFocus () {
this.$refs.pwd.focusInput()
},
blur () {
this.$refs.pwd.blur() // blur
},
clear () {
this.$refs.pwd.clear() // clear input
}
}
</script>