# dnd-drop-input

> 效果初始化如下所示：

Latest version **0.0.3** (published 2020-12-24) · 0 weekly downloads

## Install

```sh
npm install dnd-drop-input
pnpm add dnd-drop-input
yarn add dnd-drop-input
bun add dnd-drop-input
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2020-12-24 |
| First published | 2020-12-24 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | tugenhua |
| Maintainers | kongzhi0707 |
| Keywords | react, components, react-dnd, framework |

## Links

- npm: https://www.npmjs.com/package/dnd-drop-input
- Homepage: https://github.com/tugenhua0707/dnd-drop-multiInput
- npm.io page: https://npm.io/package/dnd-drop-input

## Dependencies (10)

- [antd](https://npm.io/package/antd.md) ^4.9.4
- [react](https://npm.io/package/react.md) ^16.12.0
- [react-dnd](https://npm.io/package/react-dnd.md) ^10.0.2
- [react-dom](https://npm.io/package/react-dom.md) ^16.12.0
- [customize-cra](https://npm.io/package/customize-cra.md) ^0.9.1
- [react-scripts](https://npm.io/package/react-scripts.md) ^3.4.0
- [dnd-drop-input](https://npm.io/package/dnd-drop-input.md) 0.0.1
- [@ant-design/icons](https://npm.io/package/@ant-design/icons.md) ^4.3.0
- [react-app-rewired](https://npm.io/package/react-app-rewired.md) ^2.1.5
- [react-dnd-html5-backend](https://npm.io/package/react-dnd-html5-backend.md) ^10.0.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2020-12-24
- 0.0.2 — 2020-12-24
- 0.0.1 — 2020-12-24

## README

#### 1. 进入项目的根目录，执行命令： npm install --save dnd-drop-input 下载项目到本地来。

效果初始化如下所示：

<img src="https://raw.githubusercontent.com/tugenhua0707/dnd-drop-multiInput/master/images/1.jpg" /> <br />

我们可以进行单选拖动操作，如下图：

<img src="https://raw.githubusercontent.com/tugenhua0707/dnd-drop-multiInput/master/images/2.jpg" /> <br />

同样我们也支持多选拖动操作，如下图所示：

<img src="https://raw.githubusercontent.com/tugenhua0707/dnd-drop-multiInput/master/images/3.jpg" /> <br />

代码初始化如下所示：
```
import React from 'react'
import ReactDOM from 'react-dom'
import { DndProvider } from 'react-dnd'
import Backend from 'react-dnd-html5-backend'
import DropTarget from 'dnd-drop-input'
import TestSource from './components/TestSource';

function App() {
  return (
    <div className="App">
      <DndProvider backend={Backend}>
        <DropTarget
          canDrop={true}
          onChange={(data) => {
            console.log('---返回的数据1312332132132---', data);
          }}
        />
        <TestSource />
      </DndProvider>
    </div>
  )
}

const rootElement = document.getElementById('root');
ReactDOM.render(<App />, rootElement);
```

#### 参数解析如下

```
canDrop: 必填的，必须为true，表示可以拖动到目标容器里面去。
type: 'multiSelect' 当 type = 'multiSelect', 表示的是多选操作，默认不传type值就是单选了。
onChange: 回调函数，只要操作了都提供回调，把对应的数据返回回来。
```

---
_Source: https://npm.io/package/dnd-drop-input · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
