From 2d46c9ee8b19a56237e645725365db6807123fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Mon, 21 Oct 2024 11:47:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=AD=94=E6=96=B9=E9=97=B4=E8=B7=9D?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E5=80=BC=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/model-data-magic/index.vue | 6 +++--- src/components/model-img-magic/index.vue | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/model-data-magic/index.vue b/src/components/model-data-magic/index.vue index cc4fc151..1f9ca474 100644 --- a/src/components/model-data-magic/index.vue +++ b/src/components/model-data-magic/index.vue @@ -87,10 +87,10 @@ const state = reactive({ }); // 如果需要解构,确保使用toRefs const { form, new_style } = toRefs(state); -const outer_spacing = computed(() => new_style.value.image_spacing + 'px'); -const outer_sx = computed(() => -(new_style.value.image_spacing / 2) + 'px'); +const outer_spacing = computed(() => (new_style.value?.image_spacing || 0) + 'px'); +const outer_sx = computed(() => -((new_style.value?.image_spacing || 0) / 2) + 'px'); // 图片间距设置 -const spacing = computed(() => new_style.value.image_spacing / 2 + 'px'); +const spacing = computed(() => (new_style.value?.image_spacing || 0) / 2 + 'px'); // 内容圆角设置 const content_radius = computed(() => radius_computer(new_style.value.data_radius)); // 图片圆角设置 diff --git a/src/components/model-img-magic/index.vue b/src/components/model-img-magic/index.vue index 9e8e6ac3..91a2b61f 100644 --- a/src/components/model-img-magic/index.vue +++ b/src/components/model-img-magic/index.vue @@ -57,10 +57,10 @@ const state = reactive({ }); // 如果需要解构,确保使用toRefs const { form, new_style } = toRefs(state); -const outer_spacing = computed(() => new_style.value.image_spacing + 'px'); -const outer_sx = computed(() => -(new_style.value.image_spacing / 2) + 'px'); +const outer_spacing = computed(() => (new_style.value?.image_spacing || 0) + 'px'); +const outer_sx = computed(() => -((new_style.value?.image_spacing || 0) / 2) + 'px'); // 图片间距设置 -const spacing = computed(() => new_style.value.image_spacing / 2 + 'px'); +const spacing = computed(() => (new_style.value?.image_spacing || 0) / 2 + 'px'); // 图片圆角设置 const content_img_radius = computed(() => radius_computer(new_style.value)); //#region 容器大小计算 From 5124e92d393ac3c80ea9605d05175b49e55e1f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Mon, 21 Oct 2024 13:59:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=AD=94=E6=96=B9=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/model-img-magic/index.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/model-img-magic/index.vue b/src/components/model-img-magic/index.vue index 91a2b61f..96444f09 100644 --- a/src/components/model-img-magic/index.vue +++ b/src/components/model-img-magic/index.vue @@ -57,10 +57,12 @@ const state = reactive({ }); // 如果需要解构,确保使用toRefs const { form, new_style } = toRefs(state); -const outer_spacing = computed(() => (new_style.value?.image_spacing || 0) + 'px'); -const outer_sx = computed(() => -((new_style.value?.image_spacing || 0) / 2) + 'px'); + +const new_style_spacing = computed(() => form.value.style_actived === 10 ? 0 : (new_style.value?.image_spacing || 0)); +const outer_spacing = computed(() => new_style_spacing.value + 'px'); +const outer_sx = computed(() => -(new_style_spacing.value / 2) + 'px'); // 图片间距设置 -const spacing = computed(() => (new_style.value?.image_spacing || 0) / 2 + 'px'); +const spacing = computed(() => new_style_spacing.value / 2 + 'px'); // 图片圆角设置 const content_img_radius = computed(() => radius_computer(new_style.value)); //#region 容器大小计算