From 1010a4bbed6792ecd523ba5aa81628861a37d468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Thu, 28 Apr 2022 12:14:45 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(component):=20table=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=20selected-keys=20=E5=B1=9E=E6=80=A7=20watch=20?= =?UTF-8?q?=E9=9C=80=E8=A6=81=20deep=20=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/component/src/component/table/index.vue | 7 ++++--- package/document/src/document/zh-CN/components/table.md | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package/component/src/component/table/index.vue b/package/component/src/component/table/index.vue index 8c106fad..fc547152 100644 --- a/package/component/src/component/table/index.vue +++ b/package/component/src/component/table/index.vue @@ -68,13 +68,14 @@ const changeAll = function (checked: any) { const ids = props.dataSource.map((item: any) => { return item[props.id]; }); - tableSelectedKeys.value.splice(0, ids.length); + let arr = [...tableSelectedKeys.value]; + arr.splice(0, ids.length); if (checked) { ids.forEach((id) => { - tableSelectedKeys.value.push(id); + arr.push(id); }); } - emit("update:selectedKeys", tableSelectedKeys.value); + tableSelectedKeys.value = arr; }; watch( diff --git a/package/document/src/document/zh-CN/components/table.md b/package/document/src/document/zh-CN/components/table.md index e78890a3..0c74fc70 100644 --- a/package/document/src/document/zh-CN/components/table.md +++ b/package/document/src/document/zh-CN/components/table.md @@ -237,7 +237,7 @@ export default {