Skip to content

Commit

Permalink
fix($core): global components cannot be used as layouts (close: #1321)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Mar 9, 2019
1 parent 9d01514 commit 0306574
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
</template>

<script>
import Vue from 'vue'
export default {
computed: {
layout () {
if (this.$page.path) {
if (this.$vuepress.isLayoutExists(this.$page.frontmatter.layout)) {
if (
this.$vuepress.isLayoutExists(this.$page.frontmatter.layout)
|| Boolean(Vue.component(this.$page.frontmatter.layout))
) {
return this.$page.frontmatter.layout
}
return 'Layout'
Expand Down

0 comments on commit 0306574

Please sign in to comment.