ofcold-security-code
v2.1.0
Published
A powerful security code input supports dynamic configuration of the number of input boxes.
Downloads
40
Readme
Ofcold Security Code
A powerful security code input supports dynamic configuration of the number of input boxes.
Features
- Automatic next input box.
- Page initialization automatic countdown.
- The number of custom input boxes.
- Support copy and paste.
- Support tailwindcss by version >=2.0.0
Installation
npm install --save ofcold-security-code
Usage
<!-- Html -->
<ofcold-code v-model="code"/>
VUE 2.0 And 3.0
// Javascript
import OfcoldCode from 'ofcold-security-code';
export default {
data:() => ({
code: ''
}),
components: {
OfcoldCode
}
}
// OR ...
import {defineComponent, ref} from 'vue'
import OfcoldCode from 'ofcold-security-code'
export default defineComponent({
components: {
OfcoldCode
},
setup(props, ctx) {
const code = ref('')
return {
code
}
}
})
API
isArray
Deprecated version 2.x please usereturnArray
.returnArray
boolean default false The return data type.val
string|array default ''.len
The code length default6
.size
The input size defaultmd
The options aresmall
,default
,lg
,xl
.