mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-27 05:42:36 +00:00
fix(app): throw an error when layout property is not string (#4142)
This commit is contained in:
parent
ec559750c1
commit
f5530ad653
@ -83,6 +83,9 @@ export default {
|
||||
<% } %>
|
||||
<% if (splitChunks.layouts) { %>
|
||||
setLayout (layout) {
|
||||
<% if (debug) { %>
|
||||
if(layout && typeof layout !== 'string') throw new Error('[nuxt] Avoid using non-string value as layout property.')
|
||||
<% } %>
|
||||
if (!layout || !resolvedLayouts['_' + layout]) layout = 'default'
|
||||
this.layoutName = layout
|
||||
let _layout = '_' + layout
|
||||
@ -110,6 +113,9 @@ export default {
|
||||
}
|
||||
<% } else { %>
|
||||
setLayout(layout) {
|
||||
<% if (debug) { %>
|
||||
if(layout && typeof layout !== 'string') throw new Error('[nuxt] Avoid using non-string value as layout property.')
|
||||
<% } %>
|
||||
if (!layout || !layouts['_' + layout]) {
|
||||
layout = 'default'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user