1.0.4 • Published 3 years ago
wang-create-code v1.0.4
这是一个vue的验证码生成组件
参数:
- fresh: 刷新验证码,该值变化就会刷新验证码
- contentWidth:宽度 ,默认100
- contentHeight:高度,默认35
- fontSizeMin:最小字号 ,默认18
- fontSizeMax:最大字号,默认36
用法:
1. <div class="code" @click="refreshCode">
2. <create-code :fresh="flag" @createCode="getCode" />
3. </div>
4. import createCode from "wang-create-code/index.vue"
5. export default {
6. components:{ createCode }
7. } ,
8. data(){
9. flag:true,
10. code:’’
11. },
12. methods:{
13. refreshCode() {
14. this.flag = !this.flag;
15. },
16. getCode(code) {
17. this.code = code;
18. console.log("验证码为:", this.code);
19. },
}