-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix Table indent bug when tree data is empty and expandIcon is f…
…alse #2425 (#2430) Co-authored-by: shijia.me <shijia.me@bytedance.com> Co-authored-by: pointhalo <88709023+pointhalo@users.noreply.github.com>
- Loading branch information
1 parent
a4a95a4
commit c19fc1a
Showing
5 changed files
with
114 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React from 'react'; | ||
import { Table } from '@douyinfe/semi-ui'; | ||
|
||
export default function App() { | ||
const columns = [ | ||
{ | ||
title: 'Key', | ||
dataIndex: 'dataKey', | ||
key: 'dataKey', | ||
}, | ||
{ | ||
title: '名称', | ||
dataIndex: 'name', | ||
key: 'name', | ||
width: 200, | ||
}, | ||
{ | ||
title: '数据类型', | ||
dataIndex: 'type', | ||
key: 'type', | ||
width: 400, | ||
}, | ||
]; | ||
const data = [ | ||
{ | ||
key: 99, | ||
dataKey: 99, | ||
name: 'row 99', | ||
children: [], | ||
}, | ||
{ | ||
key: 2, | ||
dataKey: 'text_info', | ||
name: '文本信息', | ||
type: 'Object 对象', | ||
description: '视频的元信息', | ||
default: '无', | ||
children: [ | ||
{ | ||
key: 21, | ||
dataKey: 'title', | ||
name: '视频标题', | ||
type: 'String 字符串', | ||
description: '视频的标题', | ||
default: '无', | ||
}, | ||
], | ||
}, | ||
]; | ||
return <div> | ||
<Table expandIcon={false} defaultExpandAllRows columns={columns} dataSource={data} /> | ||
<Table defaultExpandAllRows columns={columns} dataSource={data} /> | ||
</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.