Skip to content

Commit

Permalink
fix(design): Table columns maybe undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
dengfuping committed Oct 23, 2023
1 parent 500689f commit 3f589eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/design/src/table/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ nav:

<code src="./demo/ellipsis.tsx" title="单元格自动省略" description="设置 `column.ellipsis` 可以让单元格内容根据宽度自动省略,并使用 Tooltip 展示全部内容。`说明`: 列头缩略暂不支持和排序筛选一起使用。"></code>

<code src="./demo/edit-row.tsx" title="可编辑行" description="带行编辑功能的表格。"></code>

<code src="./demo/dynamic-settings.tsx" title="动态控制表格属性" description="选择不同配置组合查看效果。"></code>

## API
Expand Down
2 changes: 1 addition & 1 deletion packages/design/src/table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function Table<T>(props: TableProps<T>) {
const [currentSelectedRows, setCurrentSelectedRows] = useState<any[]>([]);
const [currentSelectedInfo, setCurrentSelectedInfo] = useState<any>({});

const newColumns = columns.map(item => {
const newColumns = columns?.map(item => {
if (item.ellipsis) {
return {
...item,
Expand Down

0 comments on commit 3f589eb

Please sign in to comment.