From 9a7e87bed3b8a6551b66a64f10e4f8af01ebd704 Mon Sep 17 00:00:00 2001 From: YudhistiraA Date: Tue, 7 Jan 2025 11:23:59 +0800 Subject: [PATCH 1/4] overview & fix layout webpage --- .../CMS/Webpage/Overview/OverviewWorkshop.vue | 13 ++++++++----- resources/js/Pages/Grp/Org/Web/WebpageWorkshop.vue | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/resources/js/Components/CMS/Webpage/Overview/OverviewWorkshop.vue b/resources/js/Components/CMS/Webpage/Overview/OverviewWorkshop.vue index ccbb8881f8..3b5a6a8be7 100644 --- a/resources/js/Components/CMS/Webpage/Overview/OverviewWorkshop.vue +++ b/resources/js/Components/CMS/Webpage/Overview/OverviewWorkshop.vue @@ -16,6 +16,8 @@ const props = defineProps<{ blockData: Object }>() +console.log(props) + const emits = defineEmits<{ (e: "autoSave"): void }>() @@ -25,6 +27,8 @@ const activeTextIndex = ref(-1) const activeImageIndex = ref(-1) const activeImageIndexModal = ref(-1) const isModalGallery = ref(false) +const _textRefs = ref([]) +const _imageRefs = ref([]) function onDragImage({ top = 0, bottom = 0, left = 0, right = 0 }) { props.modelValue.images[activeImageIndex.value].properties.position.top = `${top}px` @@ -121,7 +125,7 @@ onBeforeUnmount(() => { class="absolute" :class="`text-${index}`" @dblclick="activateMoveableText(index)" - ref="el => textRefs[index] = el" + :ref="el => _textRefs[index] = el" :style="{ width: text?.properties?.width ? `${text?.properties?.width}` : 'auto', height: text?.properties?.height ? `${text?.properties?.height}` : 'auto', @@ -140,7 +144,7 @@ onBeforeUnmount(() => { { class="absolute" :class="`image-${index}`" @dblclick="activateMoveableImage(index)" - ref="el => imageRefs[index] = el" + :ref="el => _imageRefs[index] = el" :style="{ width: image?.properties?.width ? `${image?.properties?.width}` : 'auto', height: image?.properties?.height ? `${image?.properties?.height}` : 'auto', @@ -174,7 +178,6 @@ onBeforeUnmount(() => { ? `${image?.properties?.position?.left}` : 'auto', }"> -