mounted() {
const that = this
window.history.pushState(null, null, '#')
window.addEventListener('popstate', function() {
window.history.pushState(null, null, '#')
that.fn()
})
},
// 这里限制返回必须写在create声明周期或者mounted声明周期
methods: {
fn() {
uni.switchTab({
url: '/pages/my/my?id=3&token='+this.token
})
}, //是一个方法,可以做返回拦截,比如封装一个弹窗,对用户返回操作进行提示
//跳转
记录h5首页物理返回键退出时,做出提示等功能
最新推荐文章于 2025-05-31 16:01:08 发布