mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 17:37:14 +00:00
Add hotReload in context
This commit is contained in:
parent
e967191167
commit
f089bcfff6
@ -270,7 +270,7 @@ function addHotReload ($component, depth) {
|
|||||||
<%= (loading ? 'this.$loading.finish && this.$loading.finish()' : '') %>
|
<%= (loading ? 'this.$loading.finish && this.$loading.finish()' : '') %>
|
||||||
router.push(path)
|
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()' : '') %>
|
<%= (loading ? 'this.$loading.start && this.$loading.start()' : '') %>
|
||||||
callMiddleware.call(this, Components, context)
|
callMiddleware.call(this, Components, context)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
@ -64,7 +64,8 @@ export function getContext (context, app) {
|
|||||||
payload: context.payload,
|
payload: context.payload,
|
||||||
error: context.error,
|
error: context.error,
|
||||||
base: '<%= router.base %>',
|
base: '<%= router.base %>',
|
||||||
env: <%= JSON.stringify(env) %>
|
env: <%= JSON.stringify(env) %>,
|
||||||
|
hotReload: context.hotReload || false
|
||||||
}
|
}
|
||||||
const next = context.next
|
const next = context.next
|
||||||
ctx.params = ctx.route.params || {}
|
ctx.params = ctx.route.params || {}
|
||||||
|
Loading…
Reference in New Issue
Block a user