|
7 年之前 | |
---|---|---|
.vscode | 7 年之前 | |
build | 7 年之前 | |
deprecated | 7 年之前 | |
example | 7 年之前 | |
src | 7 年之前 | |
.babelrc | 7 年之前 | |
.gitignore | 8 年之前 | |
LICENSE | 7 年之前 | |
README.md | 7 年之前 | |
index.js | 7 年之前 | |
package-lock.json | 7 年之前 | |
package.json | 7 年之前 | |
tsconfig.json | 7 年之前 | |
webpack.config.js | 7 年之前 | |
webpack.pro.config.js | 7 年之前 |
Dragact is a react component, which allows you to build your own dragable grid layout easily.
interface DragactProps {
layout?: DragactLayout[] //暂时不推荐使用
/**
* 宽度切分比
* 这个参数会把容器的宽度平均分为col等份
* 于是容器内元素的最小宽度就等于 containerWidth/col
*/
col: number,
/**
* 容器的宽度
*/
width: number,
/**容器内每个元素的最小高度 */
rowHeight: number,
/**
* 容器内部的padding
*/
padding?: number,
children: any[] | any
//
// interface GridItemEvent {
// event: any //浏览器拖动事件
// GridX: number //在布局中的x格子
// GridY: number //在布局中的y格子
// w: number //元素的宽度
// h: number //元素的高度
// UniqueKey: string | number //元素的唯一key
// }
/**
* 拖动开始的回调
*/
onDragStart?: (event: GridItemEvent) => void
/**
* 拖动中的回调
*/
onDrag?: (event: GridItemEvent) => void
/**
* 拖动结束的回调
*/
onDragEnd?: (key: number | string) => void
/**
* 每个元素的margin,第一个参数是左右,第二个参数是上下
*/
margin: [number, number]
/**
* layout的名字
*/
className: number | string
}
If you have a bug to report, please reproduce the bug in Github issue with a sample code to help us easily isolate it.