|
1 |
| -# 基于Vue实现的Tree组件支持拖拽 |
| 1 | +## Tree component based on Vue implementation |
2 | 2 |
|
3 |
| -### 支持搜索,checkbox勾选,大数据量时的虚拟滚动 |
| 3 | +## Simple usage |
| 4 | +```bash |
| 5 | + npm install VueTree |
| 6 | +``` |
4 | 7 |
|
5 |
| -### 更详细的API 正在整理中 |
6 | 8 |
|
| 9 | +## Advantages |
| 10 | +* Simple and very easy to use. |
| 11 | + |
| 12 | +* Big data list with high render performance and efficient. |
| 13 | + |
| 14 | + |
| 15 | +## Api |
| 16 | + |
| 17 | +### props |
| 18 | + |
| 19 | + | <
EC88
/tr>
| 20 | +Property | Type | Description | Default |
| 21 | +--- | --- | ---- | ---- |
| 22 | +treeData |Array[Object] | <div style="width:200pt">The treeNodes data Array,if set it then you need not to construct children TreeNode.(key should be unique across the whole array)</div> | - |
| 23 | +showCheckbox | boolean | Add a Checkbox before the treeNodes | false |
| 24 | +draggable | boolean | Whether to allow dropping on the node | false |
| 25 | +checkStrictly | boolean | <div style="width: 200pt">Check treeNode precisely; parent treeNode and children treeNodes are not associated</div> | false |
| 26 | +lazy | boolean | Lazy load node data | false |
| 27 | +load | function |Load data asynchronously | function(node)| - |
| 28 | +immediatelyLoad | boolean | First load data when lazy load | false |
| 29 | +virtual | boolean | Disable virtual scroll when set to false | false |
| 30 | +height | number | When virtual scroll must set | - |
| 31 | +expandedAll | boolean | Whether to expand all treeNodes by default | - |
| 32 | +keeps | number | <div style="width: 200pt">How many items you are expecting the virtual list to keep rendering in the real dom.</div> | 30 |
| 33 | +searchVal | String | Search keywords | - |
| 34 | + |
| 35 | + |
| 36 | +## Events |
| 37 | +Property | Type | Description | Params |
| 38 | + -- | -- | -- | -- |
| 39 | + on-selected-change |function | <div style="width: 150pt">Callback function for when the user right clicks a treeNode</div> | function(node) |
| 40 | + on-drop | function | Callback function for when the user drag node | function({ parentNode, targetNode, callback }) |
| 41 | + on-checked-item | function | Callback function for when the user check node | function({ node, vNode }) |
| 42 | + on-checked-change | function | Callback function for when checkbox change |function({ node, selectedData }) |
| 43 | + |
| 44 | + |
| 45 | +## Contributions |
| 46 | + |
| 47 | +Welcome to improve this component with any issue, pull request or code review. |
0 commit comments