File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/components/AppLinkInput Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,8 @@ const activeAppLink = ref({} as AppLink)
80
80
/** 打开弹窗 */
81
81
const dialogVisible = ref (false )
82
82
const open = (link : string ) => {
83
- activeAppLink .value .path = link
83
+ // 进入页面时先重置 activeAppLink
84
+ activeAppLink .value = { name: ' ' , path: ' ' }
84
85
dialogVisible .value = true
85
86
86
87
// 滚动到当前的链接
@@ -102,8 +103,11 @@ defineExpose({ open })
102
103
103
104
// 处理 APP 链接选中
104
105
const handleAppLinkSelected = (appLink : AppLink ) => {
106
+ // 只有不同链接时才更新(避免重复触发)
105
107
if (! isSameLink (appLink .path , activeAppLink .value .path )) {
106
- activeAppLink .value = appLink
108
+ // 如果新链接的 path 为空,则沿用当前 activeAppLink 的 path
109
+ const path = appLink .path || activeAppLink .value .path
110
+ activeAppLink .value = { ... appLink , path: path }
107
111
}
108
112
switch (appLink .type ) {
109
113
case APP_LINK_TYPE_ENUM .PRODUCT_CATEGORY_LIST :
You can’t perform that action at this time.
0 commit comments