Example:
Style="width: 100%"
The row - key="id"
Border
Lazy
: the load="load"
: tree - props="{children: 'children, the hasChildren:' the hasChildren '}" & gt;
Label="date"
Width="180" & gt;
Label="name"
Width="180" & gt;
Label="address" & gt;
Lazy properties that define the data for lazy loading mode. Click on the load node, triggering the load. Request the background data. Data lower load the tree node.
Requirements: there are multiple trees, needs a 1 key function, directly on the current layer all unexpanded node.
The
system at difficult points:Load (tree, treeNode, resolve) {
SetTimeout ()=& gt; {
Resolve ([
{
Id: 31,
Date: '2016-05-01',
Name: 'x.h.'
Address: 'jinshajiang road, putuo district, Shanghai 1519 lane'
}, {
Id: 32,
Date: '2016-05-01',
Name: 'x.h.'
Address: 'jinshajiang road, putuo district, Shanghai 1519 lane'
}
])
}, 1000)
}
Tree and node. But if 1 key, the system returns the multiple data how to mount the corresponding tree nodes below.
CodePudding user response:
Click one button, a root node first, to be the root node data loading is completed, to control the secondary child node button automatically click, click, when its parent data as parameters into the data and then returns the mount to have the child nodes of the attribute on the incoming parameters, so on,CodePudding user response: