@nutui/nutui-react
Version:
京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序
20 lines (19 loc) • 624 B
TypeScript
import React, { FunctionComponent } from 'react';
import { BasicComponent } from "../../utils/typings";
export interface DragState {
offset: [x: number, y: number];
}
export interface DragProps extends BasicComponent {
attract: boolean;
direction: 'x' | 'y' | 'lock' | undefined;
boundary: {
top: number;
left: number;
right: number;
bottom: number;
};
onDragStart: () => void;
onDragEnd: (state: DragState) => void;
onDrag: (state: DragState) => void;
}
export declare const Drag: FunctionComponent<Partial<DragProps> & React.HTMLAttributes<HTMLDivElement>>;