Guru Mahendran
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
components/tree/demo/dynamic.md
|
|
@ -24,7 +24,7 @@ interface DataNode { |
|
|
|
children?: DataNode[]; |
|
|
|
} |
|
|
|
|
|
|
|
const initTreeDate: DataNode[] = [ |
|
|
|
const initTreeData: DataNode[] = [ |
|
|
|
{ title: 'Expand to load', key: '0' }, |
|
|
|
{ title: 'Expand to load', key: '1' }, |
|
|
|
{ title: 'Tree Node', key: '2', isLeaf: true }, |
|
|
@ -50,7 +50,7 @@ function updateTreeData(list: DataNode[], key: React.Key, children: DataNode[]): |
|
|
|
} |
|
|
|
|
|
|
|
const Demo: React.FC<{}> = () => { |
|
|
|
const [treeData, setTreeData] = useState(initTreeDate); |
|
|
|
const [treeData, setTreeData] = useState(initTreeData); |
|
|
|
|
|
|
|
function onLoadData({ key, children }: any) { |
|
|
|
return new Promise<void>(resolve => { |
|
|
|