verification验证码
注意
点击发送验证码,通过属性isSend控制是否开启倒计时,
vue
<template>
<ws-verification
:isSend.sync="isSend"
@verifyCodeHandle="verifyCodeHandle">
</ws-verification>
</template>
<script>
export default {
data () {
return {
isSend: false, //是否已发送验证码,默认false
}
},
methods: {
//验证码点击事件,设置isSend=true手动开启倒计时,
verifyCodeHandle(){
this.isSend = true;
//一般结合表单验证和后台接口返回来设置 ,栗子:
// sendVerifyCode(data).then((res) => {
// if (res.code === 1){
// this.isSend = true;
// }
// });
}
}
}
</script>
:::
Attributes
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
isSend | 是否已发送验证码 | Boolean | false |
customClass | 自定义插件类名 | String | - |
Methods
方法名 | 说明 |
---|---|
$getModuleUrl | 绑定到Vue.prototype上,根据模块名和op值查询对应模块的请求地址及权限,参数{moduleName,op} |
$getModuleOpList | 绑定到Vue.prototype上,根据模块名查询当前模块所有配置的op,参数{moduleName} |