Skip to content
目录

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是否已发送验证码Booleanfalse
customClass自定义插件类名String-

Methods

方法名说明
$getModuleUrl绑定到Vue.prototype上,根据模块名和op值查询对应模块的请求地址及权限,参数{moduleName,op}
$getModuleOpList绑定到Vue.prototype上,根据模块名查询当前模块所有配置的op,参数{moduleName}