Skip to content

Commit

Permalink
feat: allow use components as layout (close #16)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Mar 4, 2019
1 parent 26615ea commit 7eb7e7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/components/TheMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
</template>

<script>
import Vue from 'vue'
import TransitionFadeSlide from './TransitionFadeSlide.vue'
import PostNavCard from './PostNavCard.vue'
import InfoCard from './InfoCard.vue'
Expand All @@ -46,6 +47,11 @@ export default {
return this.$page.frontmatter.layout
}
// allow all components to be used as layout
if (Vue.component(this.$page.frontmatter.layout)) {
return this.$page.frontmatter.layout
}
if (!this.$page.path) {
return 'NotFound'
}
Expand Down

0 comments on commit 7eb7e7f

Please sign in to comment.