a-draggable-component
Version:
一个可以托拽的vue3+typescript组件,主要应用场景:两个子空间的拖拽状态的相互转换
30 lines (29 loc) • 1.16 kB
TypeScript
import { ListProps } from '../a-draggable-main/type';
import { CSSProperties, Ref } from "vue";
export interface RefOptions {
width: Ref;
height: Ref;
top: Ref;
left: Ref;
topStyle: CSSProperties;
leftStyle: CSSProperties;
bottomStyle: CSSProperties;
rightStyle: CSSProperties;
}
export interface CallbackProps {
mousemoveFn: (Event: any, dom?: any) => void;
mouseupFn: (Event: any, dom?: any) => void;
mousedownFn: (Event: any, dom?: any) => void;
}
export interface ActionProps extends Partial<CallbackProps> {
initX: number;
initY: number;
state: string;
type: string;
}
export declare const mouseAddListener: (dom: any, callbackObj: Partial<CallbackProps>) => void;
export type CallbackListProps = CallbackProps[];
export declare const mouseRemoveListener: (dom: any) => void;
export declare const moveDefalutElement: (e: any, actions: ActionProps, options: Partial<RefOptions>) => void;
export declare const initActions: (actions: ActionProps) => void;
export declare const moveDraggableElement: (type: string, list: ListProps, topList: ListProps, draggableIndex: Ref, draggableType: Ref) => void;