react-dnd使用说明及列表位置切换案例
案例
dnd.tsx
import React, { useState, useRef } from 'react'
import "./dnd.less"
// react-dnd核心
import { DndProvider } from "react-dnd"
import { HTML5Backend } from "react-dnd-html5-backend"
import Item from "./components/item"
const dnd: React.FC = (props: any) => {
const types = {
item: 'item',
}
const [list, setlist] = useState([1, 2, 3, 4])
return (
{/* 只有 的子孙元素才能使用 react-d
共有 0 条评论