I\'ve deployed a VueJS
project to a domain like www.example.com
, however, I want to move it to a subfolder so that I can access it like www.examp
You can use option base
as /v1/
to move all routes to have base as /v1/
.
The base URL of the app. For example, if the entire single page application is served under /app/, then base should use the value "/app/".
How about moving all your routes to nested route, with parent route being /v1
:
const router = new VueRouter({
routes: [
{ path: 'v1', component: BaseView,
children: [
{
// UserProfile will be rendered inside BaseView's <router-view>
// when /v1/profile is matched
path: 'profile',
component: UserProfile
},
{
// UserPosts will be rendered inside BaseView's <router-view>
// when /v1/posts is matched
path: 'posts',
component: UserPosts
}
]
}
]
})