From 38d1deabef9ba14287cbec7f3a3806b8e1a11ef2 Mon Sep 17 00:00:00 2001 From: Liu Xinyu Date: Tue, 8 Jan 2019 09:41:08 +0800 Subject: [PATCH] fix($core): check if layout exists (#1166) --- .../@vuepress/core/lib/app/components/LayoutDistributor.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/@vuepress/core/lib/app/components/LayoutDistributor.vue b/packages/@vuepress/core/lib/app/components/LayoutDistributor.vue index dbe6e20627..a2fa9645ba 100644 --- a/packages/@vuepress/core/lib/app/components/LayoutDistributor.vue +++ b/packages/@vuepress/core/lib/app/components/LayoutDistributor.vue @@ -13,7 +13,10 @@ export default { computed: { layout () { if (this.$page.path) { - return this.$page.frontmatter.layout || 'Layout' + if (getLayoutAsyncComponent(this.$page.frontmatter.layout)) { + return this.$page.frontmatter.layout + } + return 'Layout' } return 'NotFound' }