mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-05 05:29:01 +08:00
47 lines
1014 B
Markdown
47 lines
1014 B
Markdown
|
<cn>
|
||
|
#### 连接线
|
||
|
带连接线的树。
|
||
|
</cn>
|
||
|
|
||
|
<us>
|
||
|
#### Tree With Line
|
||
|
Tree With Line
|
||
|
</us>
|
||
|
|
||
|
```html
|
||
|
<template>
|
||
|
<a-tree
|
||
|
showLine
|
||
|
:defaultExpandedKeys="['0-0-0']"
|
||
|
@select="onSelect"
|
||
|
>
|
||
|
<a-tree-node key="0-0">
|
||
|
<span slot="title" style="color: #1890ff">parent 1</span>
|
||
|
<a-tree-node title="parent 1-0" key="0-0-0">
|
||
|
<a-tree-node title="leaf" key="0-0-0-0" />
|
||
|
<a-tree-node title="leaf" key="0-0-0-1" />
|
||
|
<a-tree-node title="leaf" key="0-0-0-2" />
|
||
|
</a-tree-node>
|
||
|
<a-tree-node title="parent 1-1" key="0-0-1">
|
||
|
<a-tree-node title="leaf" key="0-0-1-0" />
|
||
|
</a-tree-node>
|
||
|
<a-tree-node title="parent 1-2" key="0-0-2">
|
||
|
<a-tree-node title="leaf" key="0-0-2-0" />
|
||
|
<a-tree-node title="leaf" key="0-0-2-1" />
|
||
|
</a-tree-node>
|
||
|
</a-tree-node>
|
||
|
</a-tree>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
methods: {
|
||
|
onSelect (selectedKeys, info) {
|
||
|
console.log('selected', selectedKeys, info)
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
```
|