Skip to content

Commit 0306574

Browse files
committed
fix($core): global components cannot be used as layouts (close: #1321)
1 parent 9d01514 commit 0306574

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/@vuepress/core/lib/client/components/GlobalLayout.vue

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
</template>
44

55
<script>
6+
import Vue from 'vue'
7+
68
export default {
79
computed: {
810
layout () {
911
if (this.$page.path) {
10-
if (this.$vuepress.isLayoutExists(this.$page.frontmatter.layout)) {
12+
if (
13+
this.$vuepress.isLayoutExists(this.$page.frontmatter.layout)
14+
|| Boolean(Vue.component(this.$page.frontmatter.layout))
15+
) {
1116
return this.$page.frontmatter.layout
1217
}
1318
return 'Layout'

0 commit comments

Comments
 (0)