fix:修复bug
This commit is contained in:
@@ -10,6 +10,12 @@ const props = withDefaults(defineProps<{
|
||||
});
|
||||
|
||||
function handleClickLeft() {
|
||||
// 页面栈不足时,navigateBack 会失败;兜底回首页
|
||||
const pages = getCurrentPages?.() || []
|
||||
if (pages.length <= 1) {
|
||||
uni.switchTab({ url: '/pages/home/index' })
|
||||
return
|
||||
}
|
||||
uni.navigateBack()
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user