vue下history模式ios长按识别不了二维码
单个页面:
beforeRouteEnter(to, from, next) {
// XXX: 修复iOS版微信HTML5 History兼容性问题
if (to.path !== location.pathname) {
// 此处不可使用location.replace
location.assign(to.fullPath)
} else {
next()
}
},
全局:
router.afterEach((to, from) =>{
// XXX: 修复iOS版微信HTML5 History兼容性问题
if (to.path !== location.pathname) {
// 此处不可使用location.replace
location.assign(to.fullPath)
}
})