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
9e67ec35
Commit
9e67ec35
authored
Sep 26, 2017
by
Leopoldthecoder
Committed by
杨奕
Sep 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tree: get prop from data if not specified in `props`
parent
2fae006b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
examples/docs/en-US/tree.md
examples/docs/en-US/tree.md
+1
-1
examples/docs/zh-CN/tree.md
examples/docs/zh-CN/tree.md
+1
-1
packages/tree/src/model/node.js
packages/tree/src/model/node.js
+2
-1
No files found.
examples/docs/en-US/tree.md
View file @
9e67ec35
...
...
@@ -878,7 +878,7 @@ Only one node among the same level can be expanded at one time.
| --------- | ---------------------------------------- | ------ | --------------- | ------- |
| label | specify which key of node object is used as the node's label | string, function(data, node) | — | — |
| children | specify which node object is used as the node's subtree | string, function(data, node) | — | — |
| disabled | specify which
node's checkbox
disabled | boolean, function(data, node) | — | — |
| disabled | specify which
key of node object represents if node's checkbox is
disabled | boolean, function(data, node) | — | — |
### Method
`Tree`
has the following method, which returns the currently selected array of nodes.
...
...
examples/docs/zh-CN/tree.md
View file @
9e67ec35
...
...
@@ -877,7 +877,7 @@
| -------- | ----------------- | ------ | ---- | ---- |
| label | 指定节点标签为节点对象的某个属性值 | string, function(data, node) | — | — |
| children | 指定子树为节点对象的某个属性值 | string, function(data, node) | — | — |
| disabled | 指定节点选择框是否禁用 | boolean, function(data, node) | — | — |
| disabled | 指定节点选择框是否禁用
为节点对象的某个属性值
| boolean, function(data, node) | — | — |
### 方法
`Tree`
拥有如下方法,返回目前被选中的节点数组:
...
...
packages/tree/src/model/node.js
View file @
9e67ec35
...
...
@@ -68,7 +68,8 @@ const getPropertyFromData = function(node, prop) {
}
else
if
(
typeof
config
===
'
string
'
)
{
return
data
[
config
];
}
else
if
(
typeof
config
===
'
undefined
'
)
{
return
''
;
const
dataProp
=
data
[
prop
];
return
dataProp
===
undefined
?
''
:
dataProp
;
}
};
...
...
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