A
A
Alexander Florenko2019-10-14 04:05:33
Vue.js
Alexander Florenko, 2019-10-14 04:05:33

How to remove slash in Vue Router?

Hello.
There is an application with localization. The locale is always in the url.
localhost/:locale
router.js file

{
    path: '/:locale',
    name: 'home',
    redirect: {name: 'mainPage'},
    component: () => import('Views/index'),
    children: [
        {
            path: '',
            name: 'mainPage',
            component: () => import('Views/mainPage')
        },
        {
            path: 'rooms',
            name: 'rooms',
            component: () => import('Views/rooms')
        },

All links to pages, with the exception of the main one, go without a slash at the end.
localhost/en/rooms
localhost/en/
I set it up <router-view>in several ways, but I could not achieve the desired result (
Where could I have made a mistake?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
v1rtuoz, 2019-10-15
@v1rtuoz

Something tells me that this is browser behavior.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question