diff --git a/packages/effects/common-ui/src/components/captcha/hooks/useCaptchaPoints.ts b/packages/effects/common-ui/src/components/captcha/hooks/useCaptchaPoints.ts new file mode 100644 index 00000000..6032d41a --- /dev/null +++ b/packages/effects/common-ui/src/components/captcha/hooks/useCaptchaPoints.ts @@ -0,0 +1,18 @@ +import type { CaptchaPoint } from '../types'; + +import { reactive } from 'vue'; + +export function useCaptchaPoints() { + const points = reactive([]); + function addPoint(point: CaptchaPoint) { + points.push(point); + } + function clearPoints() { + points.splice(0, points.length); + } + return { + addPoint, + clearPoints, + points, + }; +} diff --git a/packages/effects/common-ui/src/components/captcha/point-selection-captcha.vue b/packages/effects/common-ui/src/components/captcha/point-selection-captcha.vue index 3b1ac907..249cc110 100644 --- a/packages/effects/common-ui/src/components/captcha/point-selection-captcha.vue +++ b/packages/effects/common-ui/src/components/captcha/point-selection-captcha.vue @@ -1,13 +1,12 @@