UNPKG

@orca-fe/antd-plus

Version:
24 lines (23 loc) 640 B
import type React from 'react'; export type UseDraggableOptions = { /** 默认位置 x */ defaultX?: number; /** 默认位置 y */ defaultY?: number; /** 拖拽对象 ref */ ref?: React.RefObject<HTMLDivElement>; /** 使用自定义拖拽手柄 */ customHandler?: boolean; onDragStart?: () => void; onDragEnd?: () => void; }; export default function useDraggable(options?: UseDraggableOptions): [{ rootProps: { ref: React.RefObject<HTMLDivElement>; draggable: boolean; }; handleProps: { ref: React.RefObject<HTMLDivElement>; draggable: boolean; }; }];