vue有没有好的办法解决IOS微信浏览器url地址不变的问题。
使用下面代码的话,上来会无限刷新当前页面
router.afterEach((to, from) => {
const u = navigator.userAgent.toLowerCase();
console.log(to);
console.log(global);
console.log(location);
if(u.indexOf("like mac os x") < 0 || u.match(/MicroMessenger/i) != 'micromessenger' || u.match(/WebP/i) == "webp") return;
if (to.path !== global.location.pathname) {
console.log(location.assign(to.fullPath));
alert('/cloudMagicSide'+to.fullPath);
location.assign('/cloudMagicSide'+to.fullPath)
}
})
求指教###
有解决这个问题吗