@@ -84,18 +84,20 @@ const _routes = recursiveRoutes(router.routes, ' ', _components, 2)
84
84
85
85
Vue . use ( Router )
86
86
87
+ export const routerOptions = {
88
+ mode : '<%= router.mode %>' ,
89
+ base : decodeURI ( '<%= router.base %>' ) ,
90
+ linkActiveClass : '<%= router.linkActiveClass %>' ,
91
+ linkExactActiveClass : '<%= router.linkExactActiveClass %>' ,
92
+ scrollBehavior,
93
+ < %= isTest ? '/* eslint-disable quotes, object-curly-spacing, key-spacing */' : '' % >
94
+ routes : [ < %= _routes % > ],
95
+ < %= isTest ? '/* eslint-enable quotes, object-curly-spacing, key-spacing */' : '' % >
96
+ < % if ( router . parseQuery ) { % > parseQuery : < %= serializeFunction ( router . parseQuery ) % > , < % } % >
97
+ < % if ( router . stringifyQuery ) { % > stringifyQuery : < %= serializeFunction ( router . stringifyQuery ) % > , < % } % >
98
+ fallback: < %= router . fallback % >
99
+ }
100
+
87
101
export function createRouter ( ) {
88
- return new Router ( {
89
- mode : '<%= router.mode %>' ,
90
- base : decodeURI ( '<%= router.base %>' ) ,
91
- linkActiveClass : '<%= router.linkActiveClass %>' ,
92
- linkExactActiveClass : '<%= router.linkExactActiveClass %>' ,
93
- scrollBehavior,
94
- < %= isTest ? '/* eslint-disable quotes, object-curly-spacing, key-spacing */' : '' % >
95
- routes : [ < %= _routes % > ],
96
- < %= isTest ? '/* eslint-enable quotes, object-curly-spacing, key-spacing */' : '' % >
97
- < % if ( router . parseQuery ) { % > parseQuery : < %= serializeFunction ( router . parseQuery ) % > , < % } % >
98
- < % if ( router . stringifyQuery ) { % > stringifyQuery : < %= serializeFunction ( router . stringifyQuery ) % > , < % } % >
99
- fallback: < %= router . fallback % >
100
- } )
102
+ return new Router ( routerOptions )
101
103
}
0 commit comments