From 2a95b7a3e48c6b1af0bc5a9ea43d69a48a42af1a 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: Wed, 3 Aug 2022 14:15:46 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(component):=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/component/package.json | 4 +- .../component/src/component/switch/index.vue | 6 +- .../component/src/component/table/index.vue | 7 +- .../src/document/zh-CN/components/table.md | 15 +- package/document-layer/src/layouts/Layout.vue | 4 +- package/layer/package.json | 2 +- pnpm-lock.yaml | 461 +----------------- 7 files changed, 48 insertions(+), 451 deletions(-) diff --git a/package/component/package.json b/package/component/package.json index 2bdc42e0..ff434f3a 100644 --- a/package/component/package.json +++ b/package/component/package.json @@ -1,6 +1,6 @@ { "name": "@layui/layui-vue", - "version": "1.3.11", + "version": "1.3.12-alpha.2", "author": "就眠儀式", "license": "MIT", "description": "a component library for Vue 3 base on layui-vue", @@ -34,7 +34,7 @@ }, "dependencies": { "@layui/icons-vue": "^1.0.9", - "@layui/layer-vue": "^1.4.1", + "@layui/layer-vue": "^1.4.2", "@vueuse/core": "^8.7.3", "async-validator": "^4.1.1", "cropperjs": "^1.5.12", diff --git a/package/component/src/component/switch/index.vue b/package/component/src/component/switch/index.vue index 5f848482..a11b8959 100644 --- a/package/component/src/component/switch/index.vue +++ b/package/component/src/component/switch/index.vue @@ -45,7 +45,7 @@ const isActive = computed({ }, }); -const handleClick = function () { +const handleClick = () => { if (!props.disabled) { isActive.value = !isActive.value; } @@ -53,9 +53,7 @@ const handleClick = function () { const styles = computed(() => { return { - "background-color": isActive.value - ? props.onswitchColor - : props.unswitchColor, + "background-color": isActive.value ? props.onswitchColor : props.unswitchColor, }; }); diff --git a/package/component/src/component/table/index.vue b/package/component/src/component/table/index.vue index e32c62a5..5bfebc9e 100644 --- a/package/component/src/component/table/index.vue +++ b/package/component/src/component/table/index.vue @@ -80,7 +80,6 @@ const slots = slot.default && slot.default(); const allChecked = ref(false); const hasChecked = ref(false); const tableDataSource = ref([...props.dataSource]); -const tableSelectedKeys = ref([...props.selectedKeys]); const tableColumns = ref([...props.columns]); const tableColumnKeys = ref( props.columns.map((item: any) => { @@ -90,6 +89,12 @@ const tableColumnKeys = ref( }) ); +const tableSelectedKeys = ref([...props.selectedKeys]); + +watch(() => props.selectedKeys, () => { + tableSelectedKeys.value = props.selectedKeys; +},{deep: true}) + const tableSelectedKey: WritableComputedRef = computed({ get() { return props.selectedKey; diff --git a/package/document-component/src/document/zh-CN/components/table.md b/package/document-component/src/document/zh-CN/components/table.md index 8b67dec5..3d4f441a 100644 --- a/package/document-component/src/document/zh-CN/components/table.md +++ b/package/document-component/src/document/zh-CN/components/table.md @@ -685,7 +685,8 @@ export default { ::: demo 通过 `columns` 配置 `type:'checkbox'` 开启单选列。