From 76d9eb1528d163809b2afe1bf642d5f8c8a8fe02 Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Mon, 5 Jan 2026 18:57:05 +0800 Subject: [PATCH] =?UTF-8?q?style(=E8=83=8C=E6=99=AF=E5=9B=BE=E7=BB=84?= =?UTF-8?q?=E4=BB=B6):=20=E5=8F=96=E6=B6=88=E9=87=8D=E5=A4=8D=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E7=9A=84=E4=BD=BF=E7=94=A8=EF=BC=8C=E6=B2=A1=E6=B3=95?= =?UTF-8?q?=E4=BD=BF=E7=94=A8img=E6=B2=A1=E6=9C=89=E6=84=8F=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BackgroundLayer.vue | 39 ++---------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/src/components/BackgroundLayer.vue b/src/components/BackgroundLayer.vue index 8e95878..a42079e 100644 --- a/src/components/BackgroundLayer.vue +++ b/src/components/BackgroundLayer.vue @@ -1,5 +1,5 @@ @@ -46,18 +46,6 @@ const props = defineProps({ type: Boolean, default: true, }, - - // 是否使用CSS背景模式(用于重复背景等) - useCssBackground: { - type: Boolean, - default: false, - }, - - // CSS背景模式下的背景属性 - cssBackgroundProps: { - type: Object, - default: () => ({}), - }, }) // 过滤掉空的图片路径 @@ -67,29 +55,6 @@ const filteredBackgroundImages = computed(() => { } return props.backgroundImages }) - -// 合并样式 -const combinedLayerStyle = computed(() => { - if (props.useCssBackground && filteredBackgroundImages.value.length > 0) { - return { - ...props.layerStyle, - backgroundImage: `url(${filteredBackgroundImages.value[0]})`, - backgroundRepeat: props.cssBackgroundProps.repeat, - backgroundPosition: props.cssBackgroundProps.position, - backgroundSize: props.cssBackgroundProps.size, - } - } - - return { - ...props.layerStyle, - } -}) - -const combinedImageStyle = computed(() => { - return props.useCssBackground - ? { display: 'none' } // 当使用CSS背景模式时隐藏img元素 - : props.imageStyle -})