diff --git a/src/components/AppLinkInput/AppLinkSelectDialog.vue b/src/components/AppLinkInput/AppLinkSelectDialog.vue index 63f19662e3788d6c6e9846ba15e01cd9e5651a8b..2d4bea4239c914a96b0ead5e3f8e8c01b07fe10d 100644 --- a/src/components/AppLinkInput/AppLinkSelectDialog.vue +++ b/src/components/AppLinkInput/AppLinkSelectDialog.vue @@ -80,7 +80,8 @@ const activeAppLink = ref({} as AppLink) /** 打开弹窗 */ const dialogVisible = ref(false) const open = (link: string) => { - activeAppLink.value.path = link + // 进入页面时先重置 activeAppLink + activeAppLink.value = { name: '', path: '' } dialogVisible.value = true // 滚动到当前的链接 @@ -102,8 +103,11 @@ defineExpose({ open }) // 处理 APP 链接选中 const handleAppLinkSelected = (appLink: AppLink) => { + // 只有不同链接时才更新(避免重复触发) if (!isSameLink(appLink.path, activeAppLink.value.path)) { - activeAppLink.value = appLink + // 如果新链接的 path 为空,则沿用当前 activeAppLink 的 path + const path = appLink.path || activeAppLink.value.path + activeAppLink.value = { ...appLink, path: path } } switch (appLink.type) { case APP_LINK_TYPE_ENUM.PRODUCT_CATEGORY_LIST: diff --git a/src/components/DiyEditor/components/mobile/NavigationBar/components/CellProperty.vue b/src/components/DiyEditor/components/mobile/NavigationBar/components/CellProperty.vue index ea0e7ca92ef7fe88ed3a1b64537f999caac488d0..6c671d3f27c66337be7a72998b39d813bd726d0d 100644 --- a/src/components/DiyEditor/components/mobile/NavigationBar/components/CellProperty.vue +++ b/src/components/DiyEditor/components/mobile/NavigationBar/components/CellProperty.vue @@ -13,7 +13,7 @@