Vue router in the site, how to set?

Good evening! I have on the website page for example:
sitename.ru/dash/vue.php
Actually through .htaccess path looks like this:
sitename.ru/dash/vue

I'm on this page I want to be trained to use Vue and I, for example, need this page navigation view

/dash/vue/home
/dash/vue/test

Tried:

const routes = [
{
 path: '/dash/booster/',
 redirect: {
 name: 'home'
}
},
{
 name: '/dash/booster/home',
 path: '/home',
 component: HomePage
},
{
 name: '/dash/booster/test',
 path: '/test',
 component: TestPage
}
];

And
const routes = [
{
 path: '/dash/vue/',
 redirect: {
 name: 'home'
}
},
{
 name: '/dash/vue/home',
 path: '/home',
 component: HomePage
},
{
 name: '/dash/vue/test',
 path: '/test',
 component: TestPage
}
];


Didn't work -_- Tell me, what should I do? I understand you need to register somewhere the root path from Vue-router?
March 23rd 20 at 19:35
1 answer
March 23rd 20 at 19:37
Solution
const router = new Router({
 mode: 'history',
 base: '/dash/vue/',
 routes: [{
 path: '/home',
 alias: '/',
 name: 'home'.
 component: HomePage
 }, {
 name: 'test',
 path: '/test',
 component: TestPage
}]
})


the server in turn needs to :/dash/vue/**/* to give always index.html
Happened when I disabled the Rewrite rules in htaccess. Do not prompt what to do, what would the rules not to disable? - Tamia.Bosco41 commented on March 23rd 20 at 19:40

Find more questions by tags Vue.js