36 lines
911 B
Vue
36 lines
911 B
Vue
<template>
|
|
<view>
|
|
<Verify
|
|
@success="'success'"
|
|
:mode="'pop'"
|
|
:captchaType="'blockPuzzle'"
|
|
:imgSize="{ width: '330px', height: '155px' }"
|
|
ref="verify"
|
|
></Verify>
|
|
|
|
<button @click="useVerify">调用验证组件</button>
|
|
</view>
|
|
</template>
|
|
|
|
****注: mode为"pop"时,使用组件需要给组件添加ref值,并且手动调用show方法 例: this.$refs.verify.show()**** <br/>
|
|
****注: mode为"fixed"时,无需添加ref值,无需调用show()方法****
|
|
|
|
<script>
|
|
//引入组件
|
|
import Verify from "../components/verify/verify.vue";
|
|
export default {
|
|
name: 'app',
|
|
components: {
|
|
Verify
|
|
},
|
|
|
|
methods:{
|
|
success(params){
|
|
// params 返回的二次验证参数, 和登录参数一起回传给登录接口,方便后台进行二次验证
|
|
},
|
|
useVerify(){
|
|
this.$refs.verify.show()
|
|
}
|
|
}
|
|
}
|
|
</script> |