[Vuejs]-I want to get a router params in Vue Component before it created

1πŸ‘

βœ…

You should be able to use it like this:

this.$route.params.code

0πŸ‘

In the component, You can use this:

User {{ $route.params.getUserName }}

Route.js

 {
    path: "/@:getUserName",
    name: "profile",
    component: () => import("../views/ProfileView.vue"),
 }

Leave a comment