toNavigate() {
// 页面栈丢失问题修复
let canNavBack = getCurrentPages()
if (canNavBack && canNavBack.length > 1) {
uni.$emit('need', {
code: this.code,
structureName: this.structureName
});
// 使用uni.navigateBack()方法返回上一页时,也可以在上一页的onUnload钩子函数中实现数据的刷新操作。
uni.navigateBack();
} else {
uni.$emit('need', {
code: this.code,
structureName: this.structureName
});
history.back();
}
},
使用uni.navigateBack()方法返回上一页面栈丢失问题
最新推荐文章于 2024-04-18 13:55:24 发布