2019-12-31 15:45:28 +08:00
|
|
|
---
|
|
|
|
order: 99
|
|
|
|
title:
|
|
|
|
zh-CN: 大数据
|
|
|
|
en-US: Big data
|
|
|
|
debug: true
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
大数据展示。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Plenty of tree nodes.
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
2019-12-31 15:45:28 +08:00
|
|
|
import { Tree } from 'antd';
|
2022-07-04 22:09:54 +08:00
|
|
|
import type { DataNode } from 'antd/es/tree';
|
2022-05-23 14:37:16 +08:00
|
|
|
import React from 'react';
|
2019-12-31 15:45:28 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const treeData: DataNode[] = [];
|
2019-12-31 15:45:28 +08:00
|
|
|
|
|
|
|
for (let i = 0; i < 100; i += 1) {
|
2022-05-19 09:46:26 +08:00
|
|
|
const children: DataNode[] = [];
|
2019-12-31 15:45:28 +08:00
|
|
|
|
|
|
|
for (let j = 0; j < 100; j += 1) {
|
|
|
|
children.push({
|
|
|
|
title: `child ${i}-${j}`,
|
|
|
|
key: `l-${i}-${j}`,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
treeData.push({
|
|
|
|
title: `parent ${i}`,
|
|
|
|
key: `l-${i}`,
|
|
|
|
children,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => <Tree defaultExpandAll height={400} treeData={treeData} />;
|
2019-12-31 15:45:28 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
export default App;
|
2019-12-31 15:45:28 +08:00
|
|
|
```
|