Vue.js routes serving from subdirectory
I have been able to solve this, using the base
property of vue-route
.
In the case of the example it would look like this:
export default new Router({
mode: 'history',
base: '/subdir/app/',
routes: [
{
path: '/',
component: ContentView,
children: [
My question now is how can I make this subdirectory dynamically. Imagine a single server, and 2 different urls pointing to this server.
www.dominio / app1
www.dominio / app2
The assetsPublicPath
config is just for webpack assets. For vue-router, you need to set the base
option in the constructor.
See docs: https://router.vuejs.org/en/api/options.html#base