Vue ant design组件库 table表格删除一整行 为什么splice不行?

Vue ant design组件库 table表格删除一整行 为什么splice不行

<a-table
          :columns="columns"
          :rowKey="record => record.id"
          :dataSource="data"
          :pagination="pagination"
          :loading="loading"
          @change="handleTableChange"
          bordered
        >
          <template
           slot="name" slot-scope="text, record">
            <span>{{reportName}}
            <a-button type="primary"

             @click="onDelete(record.key)">删除</a-button>
            </span>
          </template>

const dataSource = [...this.dataSource];
this.dataSource = dataSource.filter(item => item.key !== key);

实际是删除了数据源对应得哪一行数据就可以

ant-design就是不支持splice删除数据的方式
可以用filter删除

    deleteRecord = (id) => {
        let newData = this.state.dataSources.filter(function (item) {
            return item.id !== id//返回你选中删除之外的所有数据
        })
        this.setState({
            dataSources: newData
        })
    }

参考下https://blog.csdn.net/weixin_41597254/article/details/107248025?utm_medium=distribute.pc_relevant_ask_down.none-task-blog-baidujs-1.nonecase&depth_1-utm_source=distribute.pc_relevant_ask_down.none-task-blog-baidujs-1.nonecase