Browse Source
fix: Improve the problem of inaccurate captcha accuracy (#4401)
fix: Improve the problem of inaccurate captcha accuracy (#4401)
* feat: captcha example * fix: fix lint errors * chore: event handling and methods * chore: add accessibility features ARIA labels and roles * refactor: refactor code structure and improve captcha demo page * feat: add captcha internationalization * chore: 适配时间戳国际化展示 * fix: 1. 添加点击位置边界校验,防止点击外部导致x,y误差。2. 演示页面宽度过长添加滚动条。3. 添加hooks ---------pull/4405/head
Squall2017
5 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 47 additions and 36 deletions
-
18packages/effects/common-ui/src/components/captcha/hooks/useCaptchaPoints.ts
-
60packages/effects/common-ui/src/components/captcha/point-selection-captcha.vue
-
5playground/src/views/examples/captcha/index.vue
@ -0,0 +1,18 @@ |
|||
import type { CaptchaPoint } from '../types'; |
|||
|
|||
import { reactive } from 'vue'; |
|||
|
|||
export function useCaptchaPoints() { |
|||
const points = reactive<CaptchaPoint[]>([]); |
|||
function addPoint(point: CaptchaPoint) { |
|||
points.push(point); |
|||
} |
|||
function clearPoints() { |
|||
points.splice(0, points.length); |
|||
} |
|||
return { |
|||
addPoint, |
|||
clearPoints, |
|||
points, |
|||
}; |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue