Appearance
Validate
滑块验证
图片验证
局部显示
vue
<template>
<op-button type="primary" @click="showImg = true">图片验证</op-button>
<op-validate
:show="showImg"
img-url="https://b18.dgcn.com/demo/captcha/getDemoPicCaptcha.ujson?captchaType=2"
vali-url="https://b18.dgcn.com/demo/captcha/validateDemoPicCaptcha.ujson"
@close="showImg = false"
@success="success"
/>
<template>
<script setup>
import { ref } from 'vue'
const showImg = ref(false)
const success = (token) => {
alert('验证成功!token:' + token)
showImg.value = false
}
</script>
Api
Property | Description | Type | Default |
---|---|---|---|
show | 显示隐藏 | boolean | false |
img-url | 获取图片url | string | |
vali-url | 验证url | string | |
container | 插入位置 | string | body |
Events Name | Description | Arguments |
---|---|---|
success | 验证成功回调 | (token) => void |
fail | 验证失败回调 | () => void |
close | 关闭弹窗 | () => void |