Skip to content

Commit 9636fa1

Browse files
committed
添加树形组件的文档
1 parent 040b8fb commit 9636fa1

File tree

3 files changed

+137
-1
lines changed

3 files changed

+137
-1
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<template>
2+
<lai-tree :data="treeData" :showCheckbox="true"></lai-tree>
3+
</template>
4+
<script>
5+
import LaiTree from './tree'
6+
export default {
7+
components: { LaiTree },
8+
data () {
9+
return {
10+
treeData: [
11+
{
12+
title: 'node_1',
13+
expand: true,
14+
children: [
15+
{
16+
title: 'node_1_1',
17+
expand: true,
18+
children: [
19+
{
20+
title: 'node_1_1_1',
21+
expand: true,
22+
},
23+
{
24+
title: 'node_1_1_2',
25+
expand: true,
26+
},
27+
{
28+
title: 'node_1_1_3',
29+
expand: true,
30+
}
31+
]
32+
},
33+
{
34+
title: 'node_1_2',
35+
expand: true,
36+
children: [
37+
{
38+
title: 'node_1_2_1',
39+
expand: true,
40+
},
41+
{
42+
title: 'node_1_2_2',
43+
expand: true,
44+
},
45+
{
46+
title: 'node_1_2_3',
47+
expand: true,
48+
}
49+
]
50+
}
51+
]
52+
}
53+
]
54+
}
55+
}
56+
}
57+
</script>

docs/.vuepress/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ module.exports = {
3737
'/posts/components/button',
3838
'/posts/components/message',
3939
'/posts/components/modal',
40-
'/posts/components/checkbox'
40+
'/posts/components/checkbox',
41+
'/posts/components/tree'
4142
]
4243
}
4344
]

docs/posts/components/tree.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Tree 树形组件
2+
3+
##### 示例
4+
5+
<box>
6+
<tree-demo></tree-demo>
7+
</box>
8+
9+
##### 代码
10+
11+
```vue
12+
<template>
13+
<box>
14+
<lai-tree :data="treeData" :showCheckbox="true"></lai-tree>
15+
</box>
16+
</template>
17+
<script>
18+
export default {
19+
data () {
20+
return {
21+
treeData: [
22+
{
23+
title: 'node_1',
24+
expand: true,
25+
children: [
26+
{
27+
title: 'node_1_1',
28+
expand: true,
29+
children: [
30+
{
31+
title: 'node_1_1_1',
32+
expand: true,
33+
},
34+
{
35+
title: 'node_1_1_2',
36+
expand: true,
37+
},
38+
{
39+
title: 'node_1_1_3',
40+
expand: true,
41+
}
42+
]
43+
},
44+
{
45+
title: 'node_1_2',
46+
expand: true,
47+
children: [
48+
{
49+
title: 'node_1_2_1',
50+
expand: true,
51+
},
52+
{
53+
title: 'node_1_2_2',
54+
expand: true,
55+
},
56+
{
57+
title: 'node_1_2_3',
58+
expand: true,
59+
}
60+
]
61+
}
62+
]
63+
}
64+
]
65+
}
66+
}
67+
}
68+
</script>
69+
```
70+
71+
<box>
72+
<mk>
73+
| 属性 | 说明 | 类型 | 默认值 |
74+
| ------------ | ------------------ | ------- | ------ |
75+
| data | 树类组件的数据 | Array | [] |
76+
| showCheckbox | 是否显示CheckBox | Boolean | false |
77+
</mk>
78+
</box>

0 commit comments

Comments
 (0)