vue-captcha-code
v1.0.2
Published
基于Vue和canvas的验证码
Downloads
630
Readme
vue-captcha-code
基于 vue
和 canvas
的一个验证码组件
安装
npm install vue-captcha-code --save
APIS
基本用法
import VueCaptcha from 'vue-captcha-code';
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
data: function() {
return {
code: '',
};
},
components: { VueCaptcha },
methods: {
handleChange(code) {
console.log('code: ', code);
},
refresh() {
this.$refs.captcha.refreshCaptcha();
},
},
template: `
<div>
<vue-captcha
ref="captcha"
:captcha.sync="code"
@on-change="handleChange">
</vue-captcha>
<div>
<button @click="refresh">刷新</button>
</div>
</div>
`,
});