* chore: update dependency version for improved stability and compatibility * fix: optimize clearPoints function in useCaptchaPoints hook to improve performance * fix: make several props optional in various components for better flexibility
20 lines
350 B
TypeScript
20 lines
350 B
TypeScript
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);
|
|
}
|
|
return {
|
|
addPoint,
|
|
clearPoints,
|
|
points,
|
|
};
|
|
}
|