0👍
It is not entirely clear what the firstUser
s are. I will assume what you did is intentional and there are two firstUser
s (one view and one component).
Specify the to
prop of the router-link
component as you would the href
attribute of a link/anchor <a>
element. That is, the route needs to begin with a slash.
<router-link to="/firstUser">
Alternatively, you might want to reduce the coupling by declaring the link by route name instead. This way, you can change the route to whatever you want without having to update your link. This can be done by using v-bind
to tell Vue to parse the prop contents, and by using different syntax.
<router-link :to="{ name: 'firstUser' }">
See the Vue Router documentation.
- [Vuejs]-Vuejs send data after close page, browser
- [Vuejs]-How to show an attribute of an item (generated by a loop) on-click?
Source:stackexchange.com