Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
351f900d
Commit
351f900d
authored
Dec 24, 2017
by
Leopoldthecoder
Committed by
杨奕
Dec 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tree: add renderAfterExpand
parent
bfa9f4ed
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
2 deletions
+14
-2
examples/docs/en-US/tree.md
examples/docs/en-US/tree.md
+1
-0
examples/docs/zh-CN/tree.md
examples/docs/zh-CN/tree.md
+1
-0
packages/tree/src/tree-node.vue
packages/tree/src/tree-node.vue
+7
-2
packages/tree/src/tree.vue
packages/tree/src/tree.vue
+5
-0
No files found.
examples/docs/en-US/tree.md
View file @
351f900d
...
@@ -937,6 +937,7 @@ Only one node among the same level can be expanded at one time.
...
@@ -937,6 +937,7 @@ Only one node among the same level can be expanded at one time.
| empty-text | text displayed when data is void | string | — | — |
| empty-text | text displayed when data is void | string | — | — |
| node-key | unique identity key name for nodes, its value should be unique across the whole tree | string | — | — |
| node-key | unique identity key name for nodes, its value should be unique across the whole tree | string | — | — |
| props | configuration options, see the following table | object | — | — |
| props | configuration options, see the following table | object | — | — |
| render-after-expand | whether to render child nodes only after a parent node is expanded for the first time | boolean | — | true |
| load | method for loading subtree data | function(node, resolve) | — | — |
| load | method for loading subtree data | function(node, resolve) | — | — |
| render-content | render function for tree node | Function(h, { node, data, store } | — | — |
| render-content | render function for tree node | Function(h, { node, data, store } | — | — |
| highlight-current | whether current node is highlighted | boolean | — | false |
| highlight-current | whether current node is highlighted | boolean | — | false |
...
...
examples/docs/zh-CN/tree.md
View file @
351f900d
...
@@ -936,6 +936,7 @@
...
@@ -936,6 +936,7 @@
| empty-text | 内容为空的时候展示的文本 | String | — | — |
| empty-text | 内容为空的时候展示的文本 | String | — | — |
| node-key | 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 | String | — | — |
| node-key | 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 | String | — | — |
| props | 配置选项,具体看下表 | object | — | — |
| props | 配置选项,具体看下表 | object | — | — |
| render-after-expand | 是否在第一次展开某个树节点后才渲染其子节点 | boolean | — | true |
| load | 加载子树数据的方法 | function(node, resolve) | — | — |
| load | 加载子树数据的方法 | function(node, resolve) | — | — |
| render-content | 树节点的内容区的渲染 Function | Function(h, { node, data, store } | — | — |
| render-content | 树节点的内容区的渲染 Function | Function(h, { node, data, store } | — | — |
| highlight-current | 是否高亮当前选中节点,默认值是 false。 | boolean | — | false |
| highlight-current | 是否高亮当前选中节点,默认值是 false。 | boolean | — | false |
...
...
packages/tree/src/tree-node.vue
View file @
351f900d
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
<el-collapse-transition>
<el-collapse-transition>
<div
<div
class=
"el-tree-node__children"
class=
"el-tree-node__children"
v-if=
"childNodeRendered"
v-if=
"
!renderAfterExpand ||
childNodeRendered"
v-show=
"expanded"
v-show=
"expanded"
role=
"group"
role=
"group"
:aria-expanded=
"expanded"
:aria-expanded=
"expanded"
...
@@ -49,6 +49,7 @@
...
@@ -49,6 +49,7 @@
<el-tree-node
<el-tree-node
:render-content=
"renderContent"
:render-content=
"renderContent"
v-for=
"child in node.childNodes"
v-for=
"child in node.childNodes"
:render-after-expand=
"renderAfterExpand"
:key=
"getNodeKey(child)"
:key=
"getNodeKey(child)"
:node=
"child"
:node=
"child"
@
node-expand=
"handleChildNodeExpand"
>
@
node-expand=
"handleChildNodeExpand"
>
...
@@ -77,7 +78,11 @@
...
@@ -77,7 +78,11 @@
}
}
},
},
props
:
{},
props
:
{},
renderContent
:
Function
renderContent
:
Function
,
renderAfterExpand
:
{
type
:
Boolean
,
default
:
true
}
},
},
components
:
{
components
:
{
...
...
packages/tree/src/tree.vue
View file @
351f900d
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
v-for=
"child in root.childNodes"
v-for=
"child in root.childNodes"
:node=
"child"
:node=
"child"
:props=
"props"
:props=
"props"
:render-after-expand=
"renderAfterExpand"
:key=
"getNodeKey(child)"
:key=
"getNodeKey(child)"
:render-content=
"renderContent"
:render-content=
"renderContent"
@
node-expand=
"handleNodeExpand"
>
@
node-expand=
"handleNodeExpand"
>
...
@@ -53,6 +54,10 @@
...
@@ -53,6 +54,10 @@
return
t
(
'
el.tree.emptyText
'
);
return
t
(
'
el.tree.emptyText
'
);
}
}
},
},
renderAfterExpand
:
{
type
:
Boolean
,
default
:
true
},
nodeKey
:
String
,
nodeKey
:
String
,
checkStrictly
:
Boolean
,
checkStrictly
:
Boolean
,
defaultExpandAll
:
Boolean
,
defaultExpandAll
:
Boolean
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment