@dfsj/ec-hooks
Version:
贵州东方世纪常用 hook。
23 lines (22 loc) • 695 B
TypeScript
type InAndOut = {
in?: (target: HTMLElement) => void;
out?: (target: HTMLElement) => void;
};
/**
* 鼠标移入移出 hook,可设置鼠标停留时间。
* hover 事件瞬间触发,不能设置停留时间
* @param inAndOut 移入移除回调
* @param inAndOut.in 移入回调
* @param inAndOut.out 移出回调
* @param options hoverIntent配置
* @link https://www.npmjs.com/package/hoverintent
*/
declare function useHover(inAndOut?: InAndOut, options?: {
sensitivity: number;
interval: number;
timeout: number;
}): {
isHover: Readonly<import('vue').Ref<boolean, boolean>>;
setHoverEle: (ele: Element, ...rest: any[]) => void;
};
export { useHover };