feat: custom home page component

This commit is contained in:
reco_luan 2019-10-20 12:59:04 +08:00
parent f4a1d1ae00
commit d06f2145e1

View File

@ -1,8 +1,7 @@
<template> <template>
<div> <div>
<Common> <Common>
<Home v-if="$frontmatter.home && $themeConfig.type !== 'blog'"/> <component v-if="$frontmatter.home" :is="homeCom"></component>
<HomeBlog v-else-if="$frontmatter.home && $themeConfig.type === 'blog'"/>
<Page <Page
v-else v-else
:sidebar-items="sidebarItems"> :sidebar-items="sidebarItems">
@ -35,6 +34,13 @@ export default {
this.$site, this.$site,
this.$localePath this.$localePath
) )
},
homeCom () {
const { type } = this.$themeConfig
if (type !== undefined) {
return type == 'blog' ? 'HomeBlog': type
}
return 'Home'
} }
} }
} }