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