App.vue中为什么要使用this.$router.onReady()

接手一个老项目,项目中使用了this.$router.onReady()

mounted() {
    this.$router.onReady(() => {
      this.initInfo()
    })
  },

我看了一下initInfo中就是取了一下query的参数来请求数据,拿不到登录信息就切回登录页,删除$router.onReady会有影响吗

阅读 3.3k
1 个回答

router.onReady是为了让动态加载的路由加载完

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题