vue项目频繁打包,导致线上路由跳转失败

router.onError(error => {
  const targetPath = router.history.pending.fullPath
  window.location.href = `/#${targetPath}`
  if (process.env.NODE_ENV !== 'development') {
    setTimeout(() => {
      window.location.reload()
    }, 0)
  }
})

你可能感兴趣的:(vue项目频繁打包,导致线上路由跳转失败)