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

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

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

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

阅读 3.5k
1 个回答

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

推荐问题