FEMessage / FEMessage/el-data-table

tableAttrs里添加elementui table的row-key属性不生效

Đang mở
#351 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Vue
Star
480
Fork
108
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## Describe the bug
tableAttrs里添加elementui table的row-key属性不生效

## Screenshots
\-

## To Reproduce
Steps to reproduce the behavior:
elementui el-table文档:

> 支持树类型的数据的显示。当 row 中包含 children 字段时,被视为树形数据。渲染树形数据时,必须要指定 row-key。支持子节点数据异步加载。设置 Table 的 lazy 属性为 true 与加载函数 load 。通过指定 row 中的 hasChildren 字段来指定哪些行是包含子节点。children 与 hasChildren 都可以通过 tree-props 配置。

1, 在数据里带有children字段的情况下, 加入row-key设置:
```
// 模拟数据
onResponse: (result) => {
const data = [{
id: 2,
parentId: 0,
nameStr: '111',
childrenExist: true,
children: [
{
id: 3,
parentId: 2,
nameStr: '222',
childrenExist: false,
}
]
}]
return {
data,
total: 2
}
},

tableAttrs: {
'row-key': 'id'
},
```
2, 仍报错 `Error: for nested data item, row-key is required.`

## Expected behavior
支持elementui el-table原生的树功能

## environment information
- Version [e.g. 22] "@femessage/el-data-table": "^1.23.0", "element-ui": "2.13.2",
- OS: win10
- Browser chrome

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.