javascript - How to pass a string containing slash ('/') as parameter to a route in vue.js -


this question has answer here:

i using vue router , have route

{ path: '/my-route/:param?', component: mycomponent } 

i have link route as

<router-link :to="'/my-route/'+myparam">link text</router-link> 

if myparam string containing '/' 'abc/def', navigates link /my-route/abc/def doesn't exists. how solve this?

you have encode url javascript function encodeuricomponent(uri)

update router-link

<router-link :to="'/my-route/'+encodeuricomponent(myparam)">link text</router-link> 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -