Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e78af6f

Browse files
committed
fix(table): getDataSource not worked on empty data
修复getDataSource获取的数据源在表格为空时返回值错误的问题。 fixed: vbenjs#752
1 parent 4ae39c5 commit e78af6f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.zh_CN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
- **Table** 修复分页抖动问题
66
- **Upload** 确保携带自定义参数
77
- **Dropdown** 修复 popConfirm 的图标显示问题
8+
- **Table** 修复树形表格的编辑事件不正常的问题
9+
- **Table** 修复当表格数据为空时,getDataSource 返回的值不是表格所使用的数据源的问题
810

911
## 2.5.0(2021-06-20)
1012

src/components/Table/src/hooks/useDataSource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function useDataSource(
113113
const getDataSourceRef = computed(() => {
114114
const dataSource = unref(dataSourceRef);
115115
if (!dataSource || dataSource.length === 0) {
116-
return [];
116+
return unref(dataSourceRef);
117117
}
118118
if (unref(getAutoCreateKey)) {
119119
const firstItem = dataSource[0];

0 commit comments

Comments
 (0)