fix(util): 优化跳转参数的空值处理逻辑
将原有的可选链空合并赋值改为条件式展开参数,避免传入无效的空值参数
This commit is contained in:
@@ -1452,8 +1452,8 @@ export default {
|
|||||||
const { wap_url, name, parent, type, appid, page, mobile, image, ...navParams } = link;
|
const { wap_url, name, parent, type, appid, page, mobile, image, ...navParams } = link;
|
||||||
this.redirectTo(link.wap_url, {
|
this.redirectTo(link.wap_url, {
|
||||||
...navParams,
|
...navParams,
|
||||||
title: link?.title ?? '',
|
...(link.title != null && { title: link.title }),
|
||||||
enable_set_title: link?.enable_set_title ? 1 : 0,
|
...(link.enable_set_title != null && { enable_set_title: link.enable_set_title ? 1 : 0 }),
|
||||||
...(link.page_params || {})
|
...(link.page_params || {})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user