Skip to content
On this page

面板(嵌入式)

使用方法

vue
<template>
  <VaptchaPanel
    v-model="token"
    v-model:server="server"
    :vid="vid"
  />
</template>
<script setup>
import '@chongying-star/vue-vaptcha/style.css';
import { VaptchaPanel } from '@chongying-star/vue-vaptcha';

const vid = '...'; // 使用你自己的vid
const token = ref(''), server = ref('');
</script>

预览

Output:

token = ""

server = ""

Attributes

AttributeDescriptionTypeAccepted ValuesDefault
vid验证单元的VIDstring?----
scene验证单元场景number?0~6--
optionVaptcha选项Readonly<Partial<VaptchaOptionClickType>>----

Props

AttributeDescriptionTypeAccepted ValuesDefault
timeoutToken过期时间(毫秒)number?--120 * 1000
disabled禁用boolean?--false

Events

Event nameDescriptionPayloads
update:modelValue更新token,可以使用v-model接收[string]
update:server更新server,可以使用v-model:server接收[string]
pass验证通过时触发[{ server: string, token: string }]
timeoutToken过期时触发[]

Slots

NameDescriptionScope
--加载时显示的文本--
loading自定义加载时显示的内容--

Exposes

NameDescriptionType
vaptchaInstancevaptcha实例ReadonlyShallowRef<CyVaptcha|undefined>
reset重置() => void
renderTokenInput向表单添加名为VAPTCHA_serverVAPTCHA_token的input标签(container?: string | HTMLElement | undefined) => void