{"_id":"@captcha-pro/taro-vue","_rev":"3-6c87f96d6ede001ebdd2986ef0f2e9e7","name":"@captcha-pro/taro-vue","dist-tags":{"latest":"2.2.0"},"versions":{"2.0.0":{"name":"@captcha-pro/taro-vue","version":"2.0.0","keywords":["captcha","taro","vue3","slider-captcha","click-captcha"],"author":{"name":"saqqdy","email":"https://github.com/saqqdy"},"license":"MIT","_id":"@captcha-pro/taro-vue@2.0.0","maintainers":[{"name":"saqqdy","email":"saqqdy@qq.com"}],"dist":{"shasum":"8df04ec8fbe81184966a04543483fcd34d0f12d7","tarball":"https://registry.npmjs.org/@captcha-pro/taro-vue/-/taro-vue-2.0.0.tgz","fileCount":8,"integrity":"sha512-+oj9jDPl0HM2sdHyLHSD3JFxLRDfmeJsiu7BksuZwXOQrrz4iugKeK1MmxuwxtodosVv68dSYrbmw3k7A2RALQ==","signatures":[{"sig":"MEUCICIbVyt20tx49+6qo3Ahy+J1sLID2v6aKeltX2qCwxcOAiEA85H5Bl4iYaXsvPlqe1/h/hVcIu752BgRBdA+6MyOZa4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":120507},"main":"dist/index.cjs","type":"module","_from":"file:captcha-pro-taro-vue-2.0.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./dist/style.css":"./dist/style.css"},"scripts":{"test":"echo 'no tests'","build":"vite build -c build/vite.config.ts","clean":"rm-all dist","watch":"vite build -c build/vite.config.ts -w"},"_npmUser":{"name":"saqqdy","email":"saqqdy@qq.com"},"_resolved":"/tmp/db6a9c3dd21411d7e558ec0275949092/captcha-pro-taro-vue-2.0.0.tgz","_integrity":"sha512-+oj9jDPl0HM2sdHyLHSD3JFxLRDfmeJsiu7BksuZwXOQrrz4iugKeK1MmxuwxtodosVv68dSYrbmw3k7A2RALQ==","_npmVersion":"10.8.2","description":"Taro + Vue 3 captcha components for captcha-pro (backend-only mode)","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@captcha-pro/mp-shared":"2.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"vue":"^3.5.39","vite":"^5.4.19","rm-all":"^1.1.1","typescript":"^5.9.3","@types/node":"^24.13.3","@tarojs/taro":"^4.2.0","@tarojs/components":"^4.2.0","@vitejs/plugin-vue":"^5.2.3"},"peerDependencies":{"vue":"^3.0.0","@tarojs/taro":"^3.0.0 || ^4.0.0","@tarojs/components":"^3.0.0 || ^4.0.0"},"peerDependenciesMeta":{"@tarojs/taro":{"optional":true},"@tarojs/components":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/taro-vue_2.0.0_1786288867606_0.9696108302589665","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@captcha-pro/taro-vue","version":"2.1.0","keywords":["captcha","taro","vue3","slider-captcha","click-captcha"],"author":{"name":"saqqdy","email":"https://github.com/saqqdy"},"license":"MIT","_id":"@captcha-pro/taro-vue@2.1.0","maintainers":[{"name":"saqqdy","email":"saqqdy@qq.com"}],"dist":{"shasum":"32ee2c524351f46963667cc468588d0a8e9313d2","tarball":"https://registry.npmjs.org/@captcha-pro/taro-vue/-/taro-vue-2.1.0.tgz","fileCount":8,"integrity":"sha512-/xBc6HKD4IWiXDWVcOsyapfkaPoRiJGJluYcNgm5fC9jGg5yEFnmx4s4JDZedIs98Sv+KCDneTJk4BsJZVKzGQ==","signatures":[{"sig":"MEUCIGK/yzg+p2oSW6J9ENJB2QuoHVXsi6rgCCNO/rYNxNOBAiEAxUtIsY/u8Y0qZeJsAoDulcyjZWQUdioRsnIESpDWV9U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":120507},"main":"dist/index.cjs","type":"module","_from":"file:captcha-pro-taro-vue-2.1.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./dist/style.css":"./dist/style.css"},"scripts":{"test":"echo 'no tests'","build":"vite build -c build/vite.config.ts","clean":"rm-all dist","watch":"vite build -c build/vite.config.ts -w"},"_npmUser":{"name":"saqqdy","email":"saqqdy@qq.com"},"_resolved":"/tmp/25a17a1528a6ac1cf4a50ac616277fd9/captcha-pro-taro-vue-2.1.0.tgz","_integrity":"sha512-/xBc6HKD4IWiXDWVcOsyapfkaPoRiJGJluYcNgm5fC9jGg5yEFnmx4s4JDZedIs98Sv+KCDneTJk4BsJZVKzGQ==","_npmVersion":"10.8.2","description":"Taro + Vue 3 captcha components for captcha-pro (backend-only mode)","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@captcha-pro/mp-shared":"2.1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"vue":"^3.5.39","vite":"^5.4.19","rm-all":"^1.1.1","typescript":"^5.9.3","@types/node":"^24.13.3","@tarojs/taro":"^4.2.0","@tarojs/components":"^4.2.0","@vitejs/plugin-vue":"^5.2.3"},"peerDependencies":{"vue":"^3.0.0","@tarojs/taro":"^3.0.0 || ^4.0.0","@tarojs/components":"^3.0.0 || ^4.0.0"},"peerDependenciesMeta":{"@tarojs/taro":{"optional":true},"@tarojs/components":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/taro-vue_2.1.0_1786844026858_0.7024040312237398","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"@captcha-pro/taro-vue","description":"Taro + Vue 3 captcha components for captcha-pro (backend-only mode)","type":"module","version":"2.2.0","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.cjs","import":"./dist/index.js","default":"./dist/index.js"},"./dist/style.css":"./dist/style.css"},"dependencies":{"@captcha-pro/mp-shared":"2.2.0"},"devDependencies":{"@tarojs/components":"^4.2.0","@tarojs/taro":"^4.2.0","@types/node":"^24.13.3","@vitejs/plugin-vue":"^5.2.3","rm-all":"^1.1.1","typescript":"^5.9.3","vite":"^5.4.19","vue":"^3.5.39"},"peerDependencies":{"@tarojs/components":"^3.0.0 || ^4.0.0","@tarojs/taro":"^3.0.0 || ^4.0.0","vue":"^3.0.0"},"peerDependenciesMeta":{"@tarojs/components":{"optional":true},"@tarojs/taro":{"optional":true}},"keywords":["captcha","taro","vue3","slider-captcha","click-captcha"],"license":"MIT","author":{"name":"saqqdy","email":"https://github.com/saqqdy"},"publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"scripts":{"build":"vite build -c build/vite.config.ts","watch":"vite build -c build/vite.config.ts -w","clean":"rm-all dist","test":"echo 'no tests'"},"_id":"@captcha-pro/taro-vue@2.2.0","_integrity":"sha512-F3ndF75MiBg/hUaF8xMwykUnP0hlaQRFfQ7yc0lvG/5sxy8uPcsyMHekr3ILVuvlsxRzhWGWFdCvmBWt7EXg4w==","_resolved":"/tmp/1f679811ff359d9716162f6f70e2b60a/captcha-pro-taro-vue-2.2.0.tgz","_from":"file:captcha-pro-taro-vue-2.2.0.tgz","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-F3ndF75MiBg/hUaF8xMwykUnP0hlaQRFfQ7yc0lvG/5sxy8uPcsyMHekr3ILVuvlsxRzhWGWFdCvmBWt7EXg4w==","shasum":"cfca09c25698e8c7f88d3e3b4a190bafd836245e","tarball":"https://registry.npmjs.org/@captcha-pro/taro-vue/-/taro-vue-2.2.0.tgz","fileCount":8,"unpackedSize":125380,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEwh6qcYo0lid6ch5aPRzw71adJQQ0jMj/LTXsqK7WaUAiAMmDDQILcP8wbsqxQg/Rz40620sxZuvsELf3GVyEYb4g=="}]},"_npmUser":{"name":"saqqdy","email":"saqqdy@qq.com"},"directories":{},"maintainers":[{"name":"saqqdy","email":"saqqdy@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/taro-vue_2.2.0_1786972755764_0.13023798806222775"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-09T15:21:07.406Z","modified":"2026-08-17T13:19:16.084Z","2.0.0":"2026-08-09T15:21:07.755Z","2.1.0":"2026-08-16T01:33:46.979Z","2.2.0":"2026-08-17T13:19:15.900Z"},"author":{"name":"saqqdy","email":"https://github.com/saqqdy"},"license":"MIT","keywords":["captcha","taro","vue3","slider-captcha","click-captcha"],"description":"Taro + Vue 3 captcha components for captcha-pro (backend-only mode)","maintainers":[{"name":"saqqdy","email":"saqqdy@qq.com"}],"readme":"# @captcha-pro/taro-vue\n\nTaro + Vue 3 captcha components for Captcha Pro (backend-only mode).\n\n**[简体中文](./README_CN.md)**\n\n## Installation\n\n```bash\npnpm add @captcha-pro/taro-vue\n```\n\n## Important: Backend-Only Mode\n\nThis package only supports backend verification mode. All captcha images are provided by backend API, `backend` configuration is required.\n\n## Usage\n\n### Global Registration\n\n```typescript\nimport { createApp } from 'vue'\nimport CaptchaPro from '@captcha-pro/taro-vue'\n\nconst app = createApp(App)\napp.use(CaptchaPro)\n```\n\n### Component Usage\n\n```vue\n<template>\n  <!-- Slider Captcha -->\n  <SliderCaptcha\n    :backend=\"backendConfig\"\n    :width=\"300\"\n    :height=\"170\"\n    @success=\"onSuccess\"\n    @fail=\"onFail\"\n  />\n\n  <!-- Click Captcha -->\n  <ClickCaptcha\n    :backend=\"backendConfig\"\n    :width=\"300\"\n    :height=\"170\"\n    @success=\"onSuccess\"\n  />\n\n  <!-- Popup Captcha -->\n  <PopupCaptcha\n    ref=\"popupRef\"\n    type=\"slider\"\n    :backend=\"backendConfig\"\n    @success=\"onSuccess\"\n  />\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { SliderCaptcha, ClickCaptcha, PopupCaptcha } from '@captcha-pro/taro-vue'\n\nconst backendConfig = {\n  getCaptcha: 'https://your-api.com/captcha/get',\n  verify: 'https://your-api.com/captcha/verify',\n  timeout: 10000,\n}\n\nconst popupRef = ref()\nconst onSuccess = () => console.log('Verification passed!')\n\n// Show popup\npopupRef.value?.show()\n</script>\n```\n\n### Using Composables\n\n```vue\n<template>\n  <view ref=\"containerRef\" class=\"captcha-container\" />\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, onMounted, onUnmounted } from 'vue'\nimport { useSliderCaptcha } from '@captcha-pro/taro-vue/composables'\n\nconst containerRef = ref()\nconst backendConfig = {\n  getCaptcha: 'https://your-api.com/captcha/get',\n  verify: 'https://your-api.com/captcha/verify',\n}\n\nconst {\n  status,\n  init,\n  refresh,\n  destroy\n} = useSliderCaptcha({\n  backend: backendConfig,\n  width: 300,\n  height: 170,\n  onSuccess: () => console.log('Passed!')\n}, containerRef)\n\nonMounted(() => init())\nonUnmounted(() => destroy())\n</script>\n```\n\n## Backend Configuration (Required)\n\n```typescript\ninterface BackendConfig {\n  getCaptcha: string | (params: any) => Promise<any>  // Required\n  verify: string | (data: any) => Promise<any>        // Required\n  headers?: Record<string, string>                     // Optional\n  timeout?: number                                     // Optional, default: 10000\n}\n```\n\nExample with custom functions:\n\n```typescript\nconst backendConfig = {\n  async getCaptcha(params) {\n    return Taro.request({\n      url: '/api/captcha/get',\n      data: params,\n    })\n  },\n  async verify(data) {\n    return Taro.request({\n      url: '/api/captcha/verify',\n      data,\n    })\n  },\n}\n```\n\n## TypeScript Support\n\nFull TypeScript support with exported types:\n\n```typescript\nimport type {\n  BackendConfig,\n  SliderCaptchaProps,\n  ClickCaptchaProps,\n  PopupCaptchaProps,\n  SliderCaptchaRef,\n  ClickCaptchaRef,\n  PopupCaptchaRef,\n} from '@captcha-pro/taro-vue'\n```\n\n## Components\n\n### SliderCaptcha\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| backend | BackendConfig | - | **Required**, backend API config |\n| width | number | 300 | Container width |\n| height | number | 170 | Container height |\n| showRefresh | boolean | true | Show refresh button |\n| locale | CaptchaLocale | 'zh-CN' | Language (i18n) |\n\n### ClickCaptcha\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| backend | BackendConfig | - | **Required**, backend API config |\n| width | number | 300 | Container width |\n| height | number | 170 | Container height |\n| showRefresh | boolean | true | Show refresh button |\n| locale | CaptchaLocale | 'zh-CN' | Language (i18n) |\n\n### PopupCaptcha\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| type | 'slider' \\| 'click' | 'slider' | Captcha type |\n| backend | BackendConfig | - | **Required**, backend API config |\n| title | string | '' | Popup title (empty → i18n `popup_title`) |\n| maskClosable | boolean | true | Close on mask click |\n| showClose | boolean | true | Show close button |\n| autoClose | boolean | true | Auto close on success |\n| locale | CaptchaLocale | 'zh-CN' | Language (i18n) |\n\n## i18n\n\nAll three components accept a `locale` prop (`'zh-CN'` | `'en-US'`). Status strings\n(loading / success / fail / prompt / popup title / errors) resolve via `getLocaleMessage(locale, key)`\nfrom `@captcha-pro/mp-shared`. Keys are aligned with the Android/iOS `LocaleMessages` set.\n\n```vue\n<SliderCaptcha :backend=\"backendConfig\" locale=\"en-US\" @success=\"onSuccess\" />\n```\n\n## Exposed Methods\n\n```vue\n<script setup>\nconst captchaRef = ref()\n\n// SliderCaptcha / ClickCaptcha methods\ncaptchaRef.value?.refresh()\n\n// PopupCaptcha methods\ncaptchaRef.value?.show()\ncaptchaRef.value?.hide()\ncaptchaRef.value?.isVisible()\n</script>\n```\n\n## Events\n\n| Event | Description | Payload |\n|-------|-------------|---------|\n| success | Verification passed | `{ verifiedAt }` |\n| fail | Verification failed | - |\n| refresh | Refresh clicked | - |\n| error | Loading error | `Error` |\n\n## License\n\nMIT","readmeFilename":"README.md"}