Skip to content

Commit

Permalink
fix(table): getDataSource not worked on empty data
Browse files Browse the repository at this point in the history
修复getDataSource获取的数据源在表格为空时返回值错误的问题。

fixed: #752
  • Loading branch information
mynetfan committed Jun 25, 2021
1 parent 4ae39c5 commit e78af6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- **Table** 修复分页抖动问题
- **Upload** 确保携带自定义参数
- **Dropdown** 修复 popConfirm 的图标显示问题
- **Table** 修复树形表格的编辑事件不正常的问题
- **Table** 修复当表格数据为空时,getDataSource 返回的值不是表格所使用的数据源的问题

## 2.5.0(2021-06-20)

Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/src/hooks/useDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export function useDataSource(
const getDataSourceRef = computed(() => {
const dataSource = unref(dataSourceRef);
if (!dataSource || dataSource.length === 0) {
return [];
return unref(dataSourceRef);
}
if (unref(getAutoCreateKey)) {
const firstItem = dataSource[0];
Expand Down

0 comments on commit e78af6f

Please sign in to comment.