Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit 6e60549

Browse files
committed
fix: allow to pass in entire router options instead of routerMode
1 parent ea30d48 commit 6e60549

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Vue.mixin({
2828

2929
class Docute {
3030
constructor(config = {}) {
31-
const router = createRouter({routerMode: config.routerMode})
31+
const router = createRouter(config.router)
3232
sync(store, router)
3333

3434
store.commit('SET_ORIGINAL_CONFIG', {

src/router.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import Home from './views/Home.vue'
44

55
Vue.use(Router)
66

7-
export default ({routerMode}) =>
7+
export default routerConfig =>
88
new Router({
9-
mode: routerMode,
10-
routes: [
11-
{
12-
path: '*',
13-
component: Home
14-
}
15-
],
169
scrollBehavior(to, from, savedPosition) {
1710
if (savedPosition) {
1811
return savedPosition
1912
}
2013
return {x: 0, y: 0}
21-
}
14+
},
15+
...routerConfig,
16+
routes: [
17+
{
18+
path: '*',
19+
component: Home
20+
}
21+
]
2222
})

0 commit comments

Comments
 (0)