Skip to content

Commit 38d1dea

Browse files
meteorlxyulivz
authored andcommitted
fix($core): check if layout exists (#1166)
1 parent a6f3699 commit 38d1dea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/@vuepress/core/lib/app/components/LayoutDistributor.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ export default {
1313
computed: {
1414
layout () {
1515
if (this.$page.path) {
16-
return this.$page.frontmatter.layout || 'Layout'
16+
if (getLayoutAsyncComponent(this.$page.frontmatter.layout)) {
17+
return this.$page.frontmatter.layout
18+
}
19+
return 'Layout'
1720
}
1821
return 'NotFound'
1922
}

0 commit comments

Comments
 (0)