Accessing $route.params in VueJS

后端 未结 1 648
有刺的猬
有刺的猬 2021-02-11 21:50

Looking through this documentation: https://router.vuejs.org/en/essentials/navigation.html

It looks like you can bind the

1条回答
  •  隐瞒了意图╮
    2021-02-11 22:43

    If you're using the Vue Loader setup (which has tags in the files), you need to use this to reference the $router, if you're doing so within the part of the file.

     console.log('The id is: ' + this.$route.params.id);
    

    0 讨论(0)
提交回复
热议问题