mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-13 07:39:10 +08:00
1dca4eba98
* fix: Tree missing selection style * test: add snapshot * test: update snapshot * docs: Update demo
29 lines
538 B
TypeScript
29 lines
538 B
TypeScript
import React from 'react';
|
|
import { Tree } from 'antd';
|
|
import type { DataNode } from 'antd/es/tree';
|
|
|
|
const treeData: DataNode[] = [
|
|
{
|
|
title: 'parent',
|
|
key: '0',
|
|
children: [
|
|
{
|
|
title: 'child 1',
|
|
key: '0-0',
|
|
disabled: true,
|
|
},
|
|
{
|
|
title: 'child 2',
|
|
key: '0-1',
|
|
disableCheckbox: true,
|
|
},
|
|
],
|
|
},
|
|
];
|
|
|
|
const App: React.FC = () => (
|
|
<Tree checkable defaultSelectedKeys={['0-1']} defaultExpandAll treeData={treeData} blockNode />
|
|
);
|
|
|
|
export default App;
|