这是uniapp的项目,现在遇到一个问题,用this.$Router.push()跳转第一次没问题,但是第二次再来的相同的页面上点某个跳转按钮就跳转不了了,跳转前打印一下to.name竟然提示是要跳到的页面的name?有遇到过这情况的吗?
import {isEmpty,isWechat} from "@/util/filter.js"
import http from '@/util/api.js'
import {RouterMount,createRouter} from 'uni-simple-router';
import {api_url} from '@/util/config.js'
const router = createRouter({
platform: process.env.VUE_APP_PLATFORM,
routes: [...ROUTES]
});
//全局路由前置守卫
router.beforeEach((to, from, next) => {
console.log('跳转之前' + to.name);
console.log(to)
if (to.path.indexOf("/api/") > 0) {
next();
return;
}
next();
});
// 全局路由后置守卫
router.afterEach((to, from) => {
uni.hideLoading();
console.log('跳转结束');
})
export {
router,
RouterMount
}
unapp跳转用这个:

navigator