update Tree Render function
This commit is contained in:
parent
97098fcd85
commit
6ff0e34003
3 changed files with 15 additions and 12 deletions
|
@ -113,9 +113,10 @@
|
|||
node () {
|
||||
const Tree = findComponentUpward(this, 'Tree');
|
||||
if (Tree) {
|
||||
return Tree.flatState.find(item => item.nodeKey === this.data.nodeKey);
|
||||
// 将所有的 node(即flatState)和当前 node 都传递
|
||||
return [Tree.flatState, Tree.flatState.find(item => item.nodeKey === this.data.nodeKey)];
|
||||
} else {
|
||||
return {};
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -4,11 +4,12 @@ export default {
|
|||
props: {
|
||||
render: Function,
|
||||
data: Object,
|
||||
node: Object
|
||||
node: Array
|
||||
},
|
||||
render: (h, ctx) => {
|
||||
const params = {
|
||||
node: ctx.props.node,
|
||||
root: ctx.props.node[0],
|
||||
node: ctx.props.node[1],
|
||||
data: ctx.props.data
|
||||
};
|
||||
return ctx.props.render(h, params);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue