mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-28 22:32:42 +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) { %>
|
<% if (splitChunks.layouts) { %>
|
||||||
setLayout (layout) {
|
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'
|
if (!layout || !resolvedLayouts['_' + layout]) layout = 'default'
|
||||||
this.layoutName = layout
|
this.layoutName = layout
|
||||||
let _layout = '_' + layout
|
let _layout = '_' + layout
|
||||||
@ -110,6 +113,9 @@ export default {
|
|||||||
}
|
}
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
setLayout(layout) {
|
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]) {
|
if (!layout || !layouts['_' + layout]) {
|
||||||
layout = 'default'
|
layout = 'default'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user