diff --git a/themes/theme.js b/themes/theme.js index a516ab66..5a237dce 100644 --- a/themes/theme.js +++ b/themes/theme.js @@ -33,13 +33,24 @@ export const getLayoutByTheme = ({ router, theme }) => { setTimeout(() => { checkThemeDOM() }, 500); - return m[getLayoutNameByPath(router.pathname, router.asPath)] + + const components = m[getLayoutNameByPath(router.pathname, router.asPath)] + if (components) { + return components + } else { + return m.LayoutSlug + } }), { ssr: true }) } else { setTimeout(() => { checkThemeDOM() }, 100); - return ThemeComponents[getLayoutNameByPath(router.pathname, router.asPath)] + const components = ThemeComponents[getLayoutNameByPath(router.pathname, router.asPath)] + if (components) { + return components + } else { + return ThemeComponents.LayoutSlug + } } }