Merge pull request #272 from cj/allow_router_mode_config

allow router mode to be set in config
This commit is contained in:
Sébastien Chopin 2017-02-17 13:49:22 +01:00 committed by GitHub
commit 5b61bd5872
3 changed files with 3 additions and 1 deletions

View File

@ -54,7 +54,7 @@ const scrollBehavior = (to, from, savedPosition) => {
<% } %> <% } %>
export default new Router({ export default new Router({
mode: 'history', mode: '<%= router.mode %>',
base: '<%= router.base %>', base: '<%= router.base %>',
linkActiveClass: '<%= router.linkActiveClass %>', linkActiveClass: '<%= router.linkActiveClass %>',
scrollBehavior, scrollBehavior,

View File

@ -172,6 +172,7 @@ function * generateRoutesAndFiles () {
uniqBy: _.uniqBy, uniqBy: _.uniqBy,
isDev: this.dev, isDev: this.dev,
router: { router: {
mode: this.options.router.mode,
base: this.options.router.base, base: this.options.router.base,
middleware: this.options.router.middleware, middleware: this.options.router.middleware,
linkActiveClass: this.options.router.linkActiveClass, linkActiveClass: this.options.router.linkActiveClass,

View File

@ -36,6 +36,7 @@ class Nuxt {
mode: 'out-in' mode: 'out-in'
}, },
router: { router: {
mode: 'history',
base: '/', base: '/',
middleware: [], middleware: [],
linkActiveClass: 'nuxt-link-active', linkActiveClass: 'nuxt-link-active',