uni-app自定义导航栏返回路径,已解决

<script>
export default {
data() {
}
// onUnload:监听页面的卸载
当前处于A页面,点击返回按钮时,则将是A页面卸载、
onUnload() {
uni.reLaunch({
url: '../index/index' //此处是重新定义返回的路径
})
},
methods: {
}
</script>
本文介绍了如何在uni-app中自定义导航栏的返回路径,当从A页面返回时,通过onUnload生命周期方法使用uni.reLaunch()重新定义返回到index/index页面,实现了页面卸载时的路径控制。
4万+

被折叠的 条评论
为什么被折叠?



