import classNames from 'clsx'; import type { FC, TouchEvent } from 'react'; import React, { useState } from 'react'; // eslint-disable-next-line react/prop-types const SvgClose: FC> = ({ className, onClick, ...props }) => { const [touchStart, setTouchStart] = useState(false); // 处理触摸开始事件 const handleTouchStart = () => { setTouchStart(true); }; // 处理触摸结束事件 const handleTouchEnd = (event: TouchEvent) => { if (touchStart) { if (onClick) onClick(event as any); } // 重置触摸状态 setTouchStart(false); }; const handleTouchMove = () => { // 触摸移动,认为不是点击事件 setTouchStart(false); }; return (
); }; export default SvgClose;