mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
Fix: error on template for layout when redirected
This commit is contained in:
parent
b26d3d6b6f
commit
ce69c3be0f
@ -19,6 +19,7 @@ const isDev = <%= isDev %>
|
||||
export default async (context) => {
|
||||
const { app, router<%= (store ? ', store' : '') %> } = await createApp(context)
|
||||
const _app = new Vue(app)
|
||||
const _noopApp = new Vue({ render: (h) => h('div') })
|
||||
// Add store to the context
|
||||
<%= (store ? 'context.store = store' : '') %>
|
||||
// Add route to the context
|
||||
@ -82,7 +83,7 @@ export default async (context) => {
|
||||
if (!context.nuxt.error) {
|
||||
await middlewareSeries(midd, ctx)
|
||||
}
|
||||
if (context.redirected) return _app
|
||||
if (context.redirected) return _noopApp
|
||||
// Set layout
|
||||
let layout = Components.length ? Components[0].options.layout : NuxtError.layout
|
||||
if (typeof layout === 'function') layout = layout(ctx)
|
||||
@ -107,7 +108,7 @@ export default async (context) => {
|
||||
if (!context.nuxt.error) {
|
||||
await middlewareSeries(midd, ctx)
|
||||
}
|
||||
if (context.redirected) return _app
|
||||
if (context.redirected) return _noopApp
|
||||
// Call .validate()
|
||||
let isValid = true
|
||||
Components.forEach((Component) => {
|
||||
|
Loading…
Reference in New Issue
Block a user