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)
    }
  })

 

posted @ 2020-08-24 16:11  岑丰涛  阅读(145)  评论(0编辑  收藏  举报