this.$router.currentRoute 和 this.$route的 区别

this.\$router.currentRoute 和 this.\$route 区别

已解决 悬赏分:0 - 解决时间 2021-12-03 07:00
反对 0举报 0 收藏 0

回答3

最佳
  • @

    两者是一样的

    console.log(this.$router.currentRoute === this.$route)  // true
    支持 0 反对 0 举报
    2021-12-02 10:46
  • @

    没区别。

    this.$route === this.$router.currentRoute //true
    支持 0 反对 0 举报
    2021-12-02 11:03
  • @

    没区别
    console.log(this.$router.currentRoute === this.$route) // true

    支持 0 反对 0 举报
    2021-12-02 12:18