fix(TopNavBar): update root page back navigation behavior
replace WeChat mini-program specific exit logic with uni.reLaunch to index page for consistent cross-platform behavior when at the root navigation stack
This commit is contained in:
@@ -155,12 +155,10 @@ const handleBack = () => {
|
||||
const pages = getCurrentPages();
|
||||
|
||||
if (pages.length <= 1) {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (typeof wx !== "undefined" && typeof wx.exitMiniProgram === "function") {
|
||||
wx.exitMiniProgram();
|
||||
return;
|
||||
}
|
||||
// #endif
|
||||
uni.reLaunch({
|
||||
url: "/pages/index/index",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasBackListener.value) {
|
||||
|
||||
Reference in New Issue
Block a user