2.0.0 • Published 5 years ago
react-drag-rotate v2.0.0
React-drag-rotate
拖动组件,支持旋转属性
example
npm install
npm start
http://localhost:3011安装组件
npm install react-drag-rotate演示:
import TransRotateCom from 'react-drag-rotate'
<TransRotateCom
position={{ x: 0, y: 0, height: 100, width: 100, rotate: 0 }}
cbActualChange={(info) => console.log('cbActualChange', info)}
cbMouseUp={(info) => console.log('cbMouseUp', info)}
/>API
props
| Parameter | Description | Type | Default |
|---|---|---|---|
| position | default position | Object | { x, y, height, width, rotate} |
| children | children | Node | null |
| isEqualRatio | single line is equal ratio | Bool | false |
| cbActualChange | actual change position callback | Func | position |
| cbMouseUp | mouse up callback | Func | position |