From c559a2d74ac71ccdd5f7cc12370afee7dc49c14e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E4=BB=AA=E5=BC=8F?= <854085467@qq.com> Date: Thu, 14 Oct 2021 00:12:38 +0800 Subject: [PATCH] =?UTF-8?q?perf(table):=20=E6=96=B0=E5=A2=9E=20v-model:sel?= =?UTF-8?q?ectedKeys=20=E9=80=89=E4=B8=AD=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/zh-CN/components/page.md | 2 - docs/docs/zh-CN/components/table.md | 17 +++---- src/module/checkbox/index.vue | 4 +- src/module/table/component/checkbox.vue | 49 ++++++++++++++++++ src/module/table/index.vue | 66 +++++++++++++++---------- 5 files changed, 96 insertions(+), 42 deletions(-) create mode 100644 src/module/table/component/checkbox.vue diff --git a/docs/docs/zh-CN/components/page.md b/docs/docs/zh-CN/components/page.md index 828c6fca..59e30021 100644 --- a/docs/docs/zh-CN/components/page.md +++ b/docs/docs/zh-CN/components/page.md @@ -107,8 +107,6 @@ export default { ::: - - ::: field page attributes ::: diff --git a/docs/docs/zh-CN/components/table.md b/docs/docs/zh-CN/components/table.md index 4bf97ef6..d8fdc803 100644 --- a/docs/docs/zh-CN/components/table.md +++ b/docs/docs/zh-CN/components/table.md @@ -127,7 +127,7 @@ export default { {{selectedKeys}} - + 新增 删除 @@ -149,10 +149,6 @@ export default { const selectedKeys = ref(['1']) - const changeSelectedKeys = function(val) { - selectedKeys.value = val - } - const columns = [ { title:"账户", @@ -184,8 +180,7 @@ export default { return { columns, dataSource, - selectedKeys, - changeSelectedKeys + selectedKeys } } } @@ -199,9 +194,9 @@ export default { | | | | | --------------- | ---------- | --- | -| columns | 列配置 | -- | -| dataSource | 数据源 | -- | -| checkbox | 开启复现框 | -- | +| columns | 列配置 | -- | +| dataSource | 数据源 | -- | +| checkbox | 开启复现框 | -- | | id | 主键 | -- | -| selectKeys | 选中项 | -- | +| selectedKeys ( v-model ) | 选中项 | -- | | default-toolbar | 开启工具栏 | -- | diff --git a/src/module/checkbox/index.vue b/src/module/checkbox/index.vue index 8f0bf74f..892f579e 100644 --- a/src/module/checkbox/index.vue +++ b/src/module/checkbox/index.vue @@ -16,7 +16,7 @@ diff --git a/src/module/table/component/checkbox.vue b/src/module/table/component/checkbox.vue new file mode 100644 index 00000000..9c11c18d --- /dev/null +++ b/src/module/table/component/checkbox.vue @@ -0,0 +1,49 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/module/table/index.vue b/src/module/table/index.vue index f9f0d89c..e5dcb63e 100644 --- a/src/module/table/index.vue +++ b/src/module/table/index.vue @@ -30,9 +30,10 @@ @@ -55,14 +56,14 @@ - + v-model="tableSelectedKeys" + > + - @@ -112,7 +113,9 @@ - +