From c40259877b164586a61f1d01cc260c318c17ecf4 Mon Sep 17 00:00:00 2001 From: cj Date: Fri, 17 Feb 2017 02:43:48 -0600 Subject: [PATCH 1/2] allow router mode to be set in config --- lib/app/router.js | 2 +- lib/nuxt.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/app/router.js b/lib/app/router.js index ce04fcc213..0deb55b696 100644 --- a/lib/app/router.js +++ b/lib/app/router.js @@ -54,7 +54,7 @@ const scrollBehavior = (to, from, savedPosition) => { <% } %> export default new Router({ - mode: 'history', + mode: '<%= router.mode %>', base: '<%= router.base %>', linkActiveClass: '<%= router.linkActiveClass %>', scrollBehavior, diff --git a/lib/nuxt.js b/lib/nuxt.js index 6982b29049..ac4d1a250c 100644 --- a/lib/nuxt.js +++ b/lib/nuxt.js @@ -36,6 +36,7 @@ class Nuxt { mode: 'out-in' }, router: { + mode: 'history', base: '/', middleware: [], linkActiveClass: 'nuxt-link-active', From 88dbe00b9e038cbda086cae1892304500f699af6 Mon Sep 17 00:00:00 2001 From: cj Date: Fri, 17 Feb 2017 03:24:30 -0600 Subject: [PATCH 2/2] add options to build --- lib/build.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/build.js b/lib/build.js index 71203675e6..f70a7bc858 100644 --- a/lib/build.js +++ b/lib/build.js @@ -172,6 +172,7 @@ function * generateRoutesAndFiles () { uniqBy: _.uniqBy, isDev: this.dev, router: { + mode: this.options.router.mode, base: this.options.router.base, middleware: this.options.router.middleware, linkActiveClass: this.options.router.linkActiveClass,