Naturally Processed Meals

    react-dragblock

    0.3.4 • Public • Published

    react-dragblock

    react drag block

    use

    import DragBlock from 'react-dragblock';
     
    // ...
     
    <DragBlock onChange={obj => console.log(obj.left)}>
      <div
        style={{
          width: '100px',
          padding: '4px',
          backgroundColor: '#a09c9c',
          color: '#fff',
        }}
      >来啊~拽我啊</div>
    </DragBlock>

    API

    参数 说明 类型 默认值 注意
    disabled 禁止拖拽 boolean false
    horizontal 仅水平方向拖拽 boolean false
    vertical 仅垂直方向拖拽 boolean false
    defaultPosition 设置默认定位 object{ x, y } { x: 0, y: 0 }
    onChange 拖拽停止,会触发 onChange 函数 Function({ left })

    Keywords

    none

    Install

    npm i react-dragblock

    DownloadsWeekly Downloads

    3

    Version

    0.3.4

    License

    MIT

    Unpacked Size

    13.3 kB

    Total Files

    6

    Last publish

    Collaborators

    • nightink