File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import Line from './line';
8
8
import Search from ' ./search' ;
9
9
import Directory from ' ./directory' ;
10
10
import ReplaceFields from ' ./replaceFields' ;
11
+ import SwitcherIcon from ' ./switcher-icon' ;
11
12
12
13
import CN from ' ../index.zh-CN.md' ;
13
14
import US from ' ../index.en-US.md' ;
@@ -45,6 +46,7 @@ export default {
45
46
< Line / >
46
47
< Search / >
47
48
< Directory / >
49
+ < SwitcherIcon / >
48
50
< api>
49
51
< template slot= " cn" >
50
52
< CN / >
Original file line number Diff line number Diff line change
1
+ <cn >
2
+ #### 自定义展开/折叠图标
3
+ 自定义展开/折叠图标。
4
+ </cn >
5
+
6
+ <us >
7
+ #### Customize collapse/expand icon
8
+ customize collapse/expand icon of tree node
9
+ </us >
10
+
11
+ ``` tpl
12
+ <template>
13
+ <a-tree
14
+ showLine
15
+ :defaultExpandedKeys="['0-0-0']"
16
+ @select="onSelect"
17
+ >
18
+ <a-icon slot="switcherIcon" type="down" />
19
+ <a-tree-node title="parent 1" key="0-0">
20
+ <a-tree-node title="parent 1-0" key="0-0-0">
21
+ <a-tree-node title="leaf" key="0-0-0-0" />
22
+ <a-tree-node title="leaf" key="0-0-0-1" />
23
+ <a-tree-node title="leaf" key="0-0-0-2" />
24
+ </a-tree-node>
25
+ <a-tree-node title="parent 1-1" key="0-0-1">
26
+ <a-tree-node title="leaf" key="0-0-1-0" />
27
+ </a-tree-node>
28
+ <a-tree-node title="parent 1-2" key="0-0-2">
29
+ <a-tree-node title="leaf" key="0-0-2-0" />
30
+ <a-tree-node title="leaf" key="0-0-2-1" />
31
+ </a-tree-node>
32
+ </a-tree-node>
33
+ </a-tree>
34
+ </template>
35
+ <script>
36
+ export default {
37
+ methods: {
38
+ onSelect(selectedKeys, info) {
39
+ console.log('selected', selectedKeys, info);
40
+ },
41
+ },
42
+ };
43
+ </script>
44
+ ```
You can’t perform that action at this time.
0 commit comments