vue3-geetest

Geetest V4 for Vue 3
3,430 4
Install
npm install vue3-geetest
Latest Version:1.0.21
Vue:3
License:MIT
Last Updated:Apr 7, 2026
Links: GitHub  ·  npm
Maintainer: devhaozi

Vue3 Geetest

安装

使用 npm 安装:

npm install vue3-geetest

使用

首先在 main.ts 中引入并注册组件:

import {Geetest} from 'vue3-geetest'

app.use(Geetest, {
    captchaId: 'xxx'
})

然后在可直接在 vue 模板中使用:

<template>
  <GeetestCaptcha :config="config" @initialized="getCaptcha" />
</template>

<script setup lang="ts">
import {GeetestCaptcha} from 'vue3-geetest'
import type {CaptchaConfig} from 'vue3-geetest'

const config: CaptchaConfig = {
  product: 'popup',
  nativeButton: {
    width: '100%',
    height: '50px'
  }
}

const getCaptcha = (instance: any) => {
  instance
    .onReady(function () {
      console.log('ready')
    })
    .onNextReady(function () {
      console.log('nextReady')
    })
    .onBoxShow(function () {
      console.log('boxShow')
    })
    .onError(function (e: any) {
      console.log(e)
    })
    .onSuccess(function () {
      console.log('success')
    })
}
</script>

instance 为极验实例对象,具体 API 方法可参考极验文档

Related Packages

vue

The progressive JavaScript framework for building modern web UI.

588,019,132 54,801
vue
@vueuse/shared
372,738,348 22,398
@vueuse/core

Collection of essential Vue Composition Utilities

367,188,523 22,398
@vitejs/plugin-vue

The official plugin for Vue SFC support in Vite.

333,357,380 686
eslint-plugin-vue

Official ESLint plugin for Vue.js

266,364,830 4,591

Version History

Version Released Vue License
1.0.21 ^3.4.0 MIT
1.0.19 ^3.4.0 WTFPL
1.0.18 ^3.4.0 WTFPL
1.0.17 ^3.4.0 WTFPL
1.0.16 ^3.4.0 WTFPL