From a69a0325177cfa20472d1d1ca295fb259fcfba4b Mon Sep 17 00:00:00 2001 From: XiaoDaiGua-Ray <443547225@qq.com> Date: Wed, 2 Aug 2023 15:44:59 +0800 Subject: [PATCH] =?UTF-8?q?bug=20fixed:=20=E4=BF=AE=E5=A4=8D=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=BD=9C=E5=9C=A8=E7=9A=84=E4=BF=AE=E6=94=B9props?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/RayCollapseGrid/src/index.tsx | 3 ++- src/components/RayCollapseGrid/src/props.ts | 2 +- src/components/RayTable/src/index.tsx | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/RayCollapseGrid/src/index.tsx b/src/components/RayCollapseGrid/src/index.tsx index 966c746d..b495b569 100644 --- a/src/components/RayCollapseGrid/src/index.tsx +++ b/src/components/RayCollapseGrid/src/index.tsx @@ -17,12 +17,13 @@ import { NCard, NGrid, NGridItem, NSpace } from 'naive-ui' import RayIcon from '@/components/RayIcon' import { call } from '@/utils/vue/index' +import { cloneDeep } from 'lodash-es' const RayCollapseGrid = defineComponent({ name: 'RayCollapseGrid', props: collapseGridProps, setup(props) { - const modelCollapsed = ref(props.value) + const modelCollapsed = ref(cloneDeep(props.open)) const handleCollapse = () => { modelCollapsed.value = !modelCollapsed.value diff --git a/src/components/RayCollapseGrid/src/props.ts b/src/components/RayCollapseGrid/src/props.ts index fd9a4537..d4cfbf23 100644 --- a/src/components/RayCollapseGrid/src/props.ts +++ b/src/components/RayCollapseGrid/src/props.ts @@ -5,7 +5,7 @@ import type { CollapseToggleText } from './type' import type { AnyFC, MaybeArray } from '@/types/modules/utils' export const collapseGridProps = { - value: { + open: { /** * * 是否折叠操作栏 diff --git a/src/components/RayTable/src/index.tsx b/src/components/RayTable/src/index.tsx index fa6a903a..deb094bb 100644 --- a/src/components/RayTable/src/index.tsx +++ b/src/components/RayTable/src/index.tsx @@ -46,6 +46,7 @@ import props from './props' import print from 'print-js' import { uuid } from '@use-utils/hook' import { exportFileToXLSX } from '@use-utils/xlsx' +import { cloneDeep } from 'lodash-es' import type { ActionOptions } from './type' import type { WritableComputedRef } from 'vue' @@ -83,7 +84,7 @@ const RayTable = defineComponent({ return cssVar }) - const tableSize = ref(props.size) + const tableSize = ref(cloneDeep(props.size)) const tableMethods = ref>() /** 注入相关属性 */