Add hotReload in context

This commit is contained in:
Sebastien Chopin 2017-05-31 13:21:24 +02:00
parent e967191167
commit f089bcfff6
2 changed files with 3 additions and 2 deletions

View File

@ -270,7 +270,7 @@ function addHotReload ($component, depth) {
<%= (loading ? 'this.$loading.finish && this.$loading.finish()' : '') %>
router.push(path)
}
let context = getContext({ route: router.currentRoute<%= (store ? ', store' : '') %>, isClient: true, next: next.bind(this), error: this.error }, app)
let context = getContext({ route: router.currentRoute<%= (store ? ', store' : '') %>, isClient: true, hotReload: true, next: next.bind(this), error: this.error }, app)
<%= (loading ? 'this.$loading.start && this.$loading.start()' : '') %>
callMiddleware.call(this, Components, context)
.then(() => {

View File

@ -64,7 +64,8 @@ export function getContext (context, app) {
payload: context.payload,
error: context.error,
base: '<%= router.base %>',
env: <%= JSON.stringify(env) %>
env: <%= JSON.stringify(env) %>,
hotReload: context.hotReload || false
}
const next = context.next
ctx.params = ctx.route.params || {}