From e0c2664bdfb4ebbda4c9d6f63bbca34268110fef 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: Mon, 18 Jul 2022 16:31:58 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(table):=20=E6=96=B0=E5=A2=9E=20type?= =?UTF-8?q?=20=E5=B1=9E=E6=80=A7=20radio=20=E5=80=BC=20=E4=B8=8E=20selecte?= =?UTF-8?q?dKey=20=E5=B1=9E=E6=80=A7,=20=E7=94=A8=E4=BA=8E=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=8D=95=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/component/table/TableRow.vue | 62 ++++++++++++++++ .../component/src/component/table/index.vue | 16 +++- .../src/document/zh-CN/components/table.md | 73 ++++++++++++++++++- package/document-component/src/view/index.vue | 4 +- 4 files changed, 149 insertions(+), 6 deletions(-) diff --git a/package/component/src/component/table/TableRow.vue b/package/component/src/component/table/TableRow.vue index fb6717bd..d52a2d97 100644 --- a/package/component/src/component/table/TableRow.vue +++ b/package/component/src/component/table/TableRow.vue @@ -19,6 +19,7 @@ export interface LayTableRowProps { expandSpace: boolean; expandIndex: number; selectedKeys: Recordable[]; + selectedKey: any; tableColumnKeys: Recordable[]; childrenColumnName?: string; columns: Recordable[]; @@ -37,6 +38,7 @@ const emit = defineEmits([ "row-double", "contextmenu", "update:selectedKeys", + "update:selectedKey", ]); const props = withDefaults(defineProps(), { @@ -55,6 +57,15 @@ const tableSelectedKeys: WritableComputedRef = computed({ }, }); +const tableSelectedKey: WritableComputedRef = computed({ + get() { + return props.selectedKey; + }, + set(val) { + emit("update:selectedKey", val); + }, +}); + const isExpand = ref(false); const slotsData = ref([]); @@ -182,6 +193,57 @@ const renderFixedClassName = (column: any, columnIndex: number) => {