Currently, I am utilizing Vue Router with a specific route setup
{ path: '/my-route/:param?', component: MyComponent }
To link to this route, I have created the following link
<router-link :to="'/my-route/'+myParam">Link text</router-link>
The issue arises when myParam
contains a string with '/' such as 'abc/def'
. This results in navigation to a link /my-route/abc/def
that does not exist. What is the best approach to resolve this problem?