Answer the question
In order to leave comments, you need to log in
Why is trailing slash added?
:to="{name: 'slug', params: {slug: article.slug}}"
adds a slash
http://example.com/qui-in-similique-necessitatibus-est/
:to="article.slug"
http://example.com/qui-in-similique-necessitatibus-est
Answer the question
In order to leave comments, you need to log in
In the first case, the router generates the URL itself, and adds a slash at the end. More details https://github.com/vuejs/vue-router/issues/1273
In the second case, it doesn't form anything, it uses what you passed in to
as is.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question