Accessing $route.params in VueJS

后端 未结 1 1648
谎友^
谎友^ 2021-02-11 21:54

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

It looks like you can bind the

1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-11 22:29

    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)
提交回复
热议问题