Fix layouts

This commit is contained in:
JhumanJ
2023-01-26 10:52:48 +01:00
parent 462f44a99c
commit bf64c01646
2 changed files with 9 additions and 3 deletions

View File

@@ -86,7 +86,13 @@ async function beforeEach (to, from, next) {
callMiddleware(middleware, to, from, (...args) => {
// Set the application layout only if "next()" was called with no args.
if (args.length === 0) {
router.app.setLayout(components[0].layout || '')
if (components[0].layout) {
router.app.setLayout(components[0].layout)
} else if (components[0].default && components[0].default.layout) {
router.app.setLayout(components[0].default.layout)
} else {
router.app.setLayout('')
}
}
next(...args)