Pre Merge pull request !830 from SNOWFLAKE/master

pull/830/MERGE
SNOWFLAKE 2025-12-20 12:48:40 +00:00 committed by Gitee
commit 0f86e147d4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 15 additions and 3 deletions

View File

@ -142,7 +142,7 @@
>
<!-- 组件名称 -->
<template #header>
<div class="flex items-center gap-8px">
<div class="flex items-center gap-[8px]">
<Icon :icon="selectedComponent?.icon" color="gray" />
<span>{{ selectedComponent?.name }}</span>
</div>
@ -167,7 +167,7 @@
<div class="flex justify-around">
<IFrame
:src="previewUrl"
class="w-375px border-4px border-rounded-8px border-solid p-2px h-667px!"
class="w-[375px] border-[4px] border-rounded-[8px] border-solid p-[2px] h-[667px]!"
/>
<div class="flex flex-col">
<el-text>手机扫码预览</el-text>
@ -233,11 +233,15 @@ const props = defineProps({
previewUrl: propTypes.string.def('')
})
const isUpdatingFromProp = ref(false)
//
// pageConfigComponent navigationBarComponentpageComponentstabBarComponent
watch(
() => props.modelValue,
() => {
//
isUpdatingFromProp.value = true
const modelValue =
isString(props.modelValue) && !isEmpty(props.modelValue)
? (JSON.parse(props.modelValue) as PageConfig)
@ -256,9 +260,14 @@ watch(
return { ...component, property: item.property }
}
)
// tick
nextTick(() => {
isUpdatingFromProp.value = false
})
},
{
immediate: true
immediate: true,
deep: true //
}
)
@ -302,6 +311,7 @@ const pageConfigChange = () => {
const modelValue = isString(props.modelValue) ? JSON.stringify(pageConfig) : pageConfig
emits('update:modelValue', modelValue)
}
//
watch(
() => [
pageConfigComponent.value.property,
@ -310,6 +320,8 @@ watch(
pageComponents.value
],
() => {
//
if (isUpdatingFromProp.value) return
pageConfigChange()
},
{ deep: true }