0.1.28 • Published 2 years ago
@asany/tree v0.1.28
React Tree
React 排序树组件
Install
npm i @asany/tree # or yarn add @asany/tree
Usage
const Example = () => {
const [items, setItems] = useState([
{
key: '1',
title: '荣耀',
type: 'directory',
children: [
{ key: '11', title: '鲁班7号', type: 'file' },
{ key: '12', title: '廉颇', type: 'file' },
{ key: '13', title: '凯', type: 'file' },
{
key: '14',
title: '长城守卫军',
type: 'directory',
children: [{ key: '15', title: '苏烈', type: 'file' }],
},
{ key: '121', title: '所得', type: 'file' },
],
},
{ key: '2', title: '老王', type: 'file' },
{ key: '3', title: '老五', type: 'file' },
{ key: '4', title: '张三', type: 'file' },
{ key: '5', title: '赵六', type: 'file' },
{
key: '7',
title: '王者营地',
type: 'directory',
children: [],
},
]);
const handleChange = (data, event) => {
setItems(data);
};
return (
<DndProvider backend={HTML5Backend}>
<Tree treeData={items} />
</DndProvider>
);
};
Maintainers
License
MIT © 李茂峰
0.1.27
2 years ago
0.1.28
2 years ago
0.1.22
3 years ago
0.1.23
2 years ago
0.1.24
2 years ago
0.1.25
2 years ago
0.1.26
2 years ago
0.1.20
3 years ago
0.1.21
3 years ago
0.1.15
3 years ago
0.1.16
3 years ago
0.1.17
3 years ago
0.1.18
3 years ago
0.1.19
3 years ago
0.1.14
3 years ago
0.1.13
3 years ago
0.1.12
3 years ago
0.1.11
3 years ago
0.1.10
3 years ago
0.1.9
3 years ago
0.1.8
3 years ago
0.1.7
3 years ago
0.1.6
3 years ago
0.1.5
3 years ago
0.1.4
3 years ago
0.1.3
3 years ago
0.1.2
3 years ago