0π
In this case I see two solutions
- along with routerName you also need to compare query params which can be accessed by:
this.$route.query. accountType
- You can compare $route.fullPath which includes URL including query and hash.
But I am not sure why you have these two routes different: ideally these should be ideally same route with different query Param. Also have a look at this answer.
0π
Per docs: https://router.vuejs.org/en/api/router-link.html
I would suggest to use:
<!-- with query, resulting in /register?plan=private -->
<router-link :to="{ path: 'accountType', query: { accountType: '1' }}"></router-link>
<router-link :to="{ path: 'accountType', query: { accountType: '2' }}"></router-link>
- [Vuejs]-Unable to toggle drop down value based on other column
- [Vuejs]-How to upload images with Rails-Api + Vue.js + Cloudinary + Attachinary?
Source:stackexchange.com