Although it may seem straightforward, I'm struggling to find the most efficient method for this particular scenario in Vue.js.
I am using Vue Cli 3 and I need to have multiple routes leading to the same Home page within the application.
The idea is to have an affiliate number as a parameter - or no affiliate at all.
What I've tried so far is defining two different paths pointing to the same home component in router.js:
{
path: '/',
name: 'home',
component: Home
},
{
path: '/affId=:affiliateNumber?',
name: 'home',
component: Home
},
This code technically works, but it's not an ideal solution as it triggers a warning stating '[vue-router] Duplicate named routes definition'.
Could someone offer advice on the best approach to tackle this issue? Any help would be greatly appreciated.