react-view-drag
智能拖拽主键
Install
npm install --save react-view-drag
Usage
import DragView from 'react-view-drag'
props:{
children?: any;//将需要拖拽的内容用DragView 包裹
style?: CSSProperties;//自定义样式
className?: string;//自定义class
keyId: string | number;//唯一id
onEnd?: any;//拖拽后回调触发函数(a,b,c)=>{}
onGroupsEnd?: any;//拖拽后分组回调触发函数(a,b,c)=>{}
type: propsType[]; // 1,2,3,4,5:左,右,上,下,中 支持五边触发触发
isDrag: boolean;//是否支持拖拽
isNoMoveItem?: boolean;//是否支持拖拽
noTransform?: boolean;//是否屏蔽 Transform
indicateColor?: string;//边框颜色
item?: any;//需要拖拽携带的数据
index?: number;//索引
getDragNode?: (dragNode: any) => void;//需要拖拽携带的数据
groups?: string[] | string | undefined //组名 例如[a],[b],[a,b]那么[a][b]能拖拽到[a,b],[a][b]不能相互拖拽
}
License
作者
qghs