mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-06 21:10:38 +00:00
context: hotReload -> isHMR
This commit is contained in:
parent
459363beea
commit
4ac14054f2
@ -1,6 +1,6 @@
|
||||
export default function ({ app, store, route, params, error, redirect, hotReload }) {
|
||||
// If middleware is called from hot-reloading, ignore it
|
||||
if (hotReload) return
|
||||
export default function ({ isHMR, app, store, route, params, error, redirect }) {
|
||||
// If middleware is called from hot module replacement, ignore it
|
||||
if (isHMR) return
|
||||
// Get locale from params
|
||||
const locale = params.lang || 'en'
|
||||
if (store.state.locales.indexOf(locale) === -1) {
|
||||
|
@ -457,7 +457,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, hotReload: true, next: next.bind(this), error: this.error }, app)
|
||||
let context = getContext({ route: router.currentRoute<%= (store ? ', store' : '') %>, isClient: true, isHMR: true, next: next.bind(this), error: this.error }, app)
|
||||
<%= (loading ? 'this.$loading.start && this.$loading.start()' : '') %>
|
||||
callMiddleware.call(this, Components, context)
|
||||
.then(() => {
|
||||
|
@ -75,14 +75,14 @@ export function getContext (context, app) {
|
||||
isClient: !!context.isClient,
|
||||
isStatic: process.static,
|
||||
isDev: <%= isDev %>,
|
||||
isHMR: context.isHMR || false,
|
||||
app: app,
|
||||
<%= (store ? 'store: context.store,' : '') %>
|
||||
route: (context.to ? context.to : context.route),
|
||||
payload: context.payload,
|
||||
error: context.error,
|
||||
base: '<%= router.base %>',
|
||||
env: <%= JSON.stringify(env) %>,
|
||||
hotReload: context.hotReload || false
|
||||
env: <%= JSON.stringify(env) %>
|
||||
}
|
||||
const next = context.next
|
||||
ctx.params = ctx.route.params || {}
|
||||
|
Loading…
Reference in New Issue
Block a user