ElemeFE / ElemeFE/element-react

table表格使用splice删除数据后,表格数据依然存在

Open
#979 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.8k
Forks
435
PR merge metrics
No merged PRs in 30d

Description

### Description

table表格删除数据后,数据依然存在,并且数据清空后会出现暂时数据表格和数据同时存在

### Reproduce Steps
```
const {data} = this.state;
data.splice(0, 1);
this.setState({
data
})
```
使用这种方式删除数据后,表格数据依然存在,一直删除完所有的数据,表格数据没发生变化,但是,多出一列‘暂无数据’

暂时可以使用```const data = [...this.state.data]```解决
![image](https://user-images.githubusercontent.com/26834525/57270783-580fb680-70bf-11e9-8e3e-e806eff81681.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.