mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
App.vue: check resolvedLayouts
in setLayout
This commit is contained in:
parent
4abbb4eb9c
commit
e686844b03
@ -35,14 +35,14 @@ export default {
|
|||||||
<% } %>
|
<% } %>
|
||||||
methods: {
|
methods: {
|
||||||
setLayout (layout) {
|
setLayout (layout) {
|
||||||
if (!layout || !layouts['_' + layout]) layout = 'default'
|
if (!layout || !resolvedLayouts['_' + layout]) layout = 'default'
|
||||||
this.layoutName = layout
|
this.layoutName = layout
|
||||||
let _layout = '_' + layout
|
let _layout = '_' + layout
|
||||||
this.layout = layouts[_layout]
|
this.layout = resolvedLayouts[_layout]
|
||||||
return this.layout
|
return this.layout
|
||||||
},
|
},
|
||||||
loadLayout (layout) {
|
loadLayout (layout) {
|
||||||
if (!layout || !layouts['_' + layout]) layout = 'default'
|
if (!layout || !(layouts['_' + layout] || resolvedLayouts['_' + layout])) layout = 'default'
|
||||||
let _layout = '_' + layout
|
let _layout = '_' + layout
|
||||||
if (resolvedLayouts[_layout]) {
|
if (resolvedLayouts[_layout]) {
|
||||||
return Promise.resolve(resolvedLayouts[_layout])
|
return Promise.resolve(resolvedLayouts[_layout])
|
||||||
|
Loading…
Reference in New Issue
Block a user