From bd510ffc2710c29054dbb9e917ad5fa4b6d32c55 Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Fri, 23 Aug 2024 09:55:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=9E=E6=97=B6=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E4=B8=8E=E8=A7=86=E9=A2=91=E6=A1=86=E5=8F=98=E5=8A=A8?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/lowcodeimage/lowcodeImage.vue | 32 +++++++++++++++++----- src/widget/videoupload/videoUploadPlay.vue | 19 +++++++++++-- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/src/widget/lowcodeimage/lowcodeImage.vue b/src/widget/lowcodeimage/lowcodeImage.vue index dbc4f18..12174a9 100644 --- a/src/widget/lowcodeimage/lowcodeImage.vue +++ b/src/widget/lowcodeimage/lowcodeImage.vue @@ -29,10 +29,10 @@ const props = defineProps({ /* */ -let styleObject = { - -} - +let styleObject = reactive({ + width:"0", + height:"0" +}) const emits = defineEmits(["update:imgUrl","updateCont"]); @@ -66,8 +66,8 @@ switch (fitNum) { break; } -const showMode = props.data?.control.showMode - +const showMode = reactive(props.data?.control.showMode) +// console.log("图片像素样式-1-》",props.data?.control); if (showMode==='自定义像素值') { const pxWidth = props.data?.control.pxWidth const pxHeight = props.data?.control.pxHeight @@ -80,6 +80,24 @@ if (showMode==='自定义像素值') { styleObject.height = heightPercent+'%'; } +watch(()=>props.data?.control, (val) => { + + if (val.showMode==='自定义像素值') { + const pxWidth = props.data?.control.pxWidth + const pxHeight = props.data?.control.pxHeight + styleObject.width = pxWidth+'px'; + styleObject.height = pxHeight+'px'; + }else{ + const widthPercent = props.data?.control.widthPercent + const heightPercent = props.data?.control.heightPercent + styleObject.width = widthPercent+'%'; + styleObject.height = heightPercent+'%'; + } +},{ + deep: true, +}) + + const radius = props.data?.control.radius const radiusClass = ref(''); let radiusClassIsActive = false @@ -188,7 +206,7 @@ watch(() =>props.imgUrl,(val)=>{