1.0.24 • Published 7 years ago
drag-compoment v1.0.24
Dragme
Dragme is an drag component with react.js
Use this component to wrap the components you want to drag Or assign the component that you want to drag to the content props
preview:
npm run demo
install:
npm install drag-compoment --save
How to using:
import Dragme from 'drag-compoment'
<Dragme {...props}><YouCompoment /></Dragme>
or
<Dragme
content={<YouComponent />}
{...props}
/>
APIS
- onStart:
- Call when move start\ @params {Object} e Event Object
- onEnd:
- Call when move end\ @params {Object} e Event Object
- onMove:
- Call when moving\ @params {Number} left content left value\ @params {Number} top content top value\ @params {Object} e Event Object
props
- top
- Initial top value
- left
- Initial left value
- Content width
- Drag acceleration default 0