fix($core): check if layout exists (#1166)

This commit is contained in:
Liu Xinyu
2019-01-08 09:41:08 +08:00
committed by ULIVZ
parent a6f36990ea
commit 38d1deabef
@@ -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'
}