ant-design-vue/components/tree/demo/directory.md

37 lines
937 B
Markdown
Raw Normal View History

2018-09-28 06:35:26 +00:00
<cn>
#### 目录
内置的目录树,`multiple` 模式支持 `ctrl(Windows)` / `command(Mac)` 复选。
</cn>
<us>
#### Directory
Built-in directory tree. `multiple` support `ctrl(Windows)` / `command(Mac)` selection.
</us>
2019-10-09 10:32:23 +00:00
```tpl
2018-09-28 06:35:26 +00:00
<template>
2019-09-28 12:45:07 +00:00
<a-directory-tree multiple defaultExpandAll @select="onSelect" @expand="onExpand">
2018-09-28 06:35:26 +00:00
<a-tree-node title="parent 0" key="0-0">
<a-tree-node title="leaf 0-0" key="0-0-0" isLeaf />
<a-tree-node title="leaf 0-1" key="0-0-1" isLeaf />
</a-tree-node>
<a-tree-node title="parent 1" key="0-1">
<a-tree-node title="leaf 1-0" key="0-1-0" isLeaf />
<a-tree-node title="leaf 1-1" key="0-1-1" isLeaf />
</a-tree-node>
</a-directory-tree>
</template>
<script>
2019-09-28 12:45:07 +00:00
export default {
methods: {
onSelect(keys) {
console.log('Trigger Select', keys);
},
onExpand() {
console.log('Trigger Expand');
},
2018-09-28 06:35:26 +00:00
},
2019-09-28 12:45:07 +00:00
};
2018-09-28 06:35:26 +00:00
</script>
```