Skip to content

Commit d06f214

Browse files
author
reco_luan
committed
feat: custom home page component
1 parent f4a1d1a commit d06f214

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

layouts/Layout.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<template>
22
<div>
33
<Common>
4-
<Home v-if="$frontmatter.home && $themeConfig.type !== 'blog'"/>
5-
<HomeBlog v-else-if="$frontmatter.home && $themeConfig.type === 'blog'"/>
4+
<component v-if="$frontmatter.home" :is="homeCom"></component>
65
<Page
76
v-else
87
:sidebar-items="sidebarItems">
@@ -35,6 +34,13 @@ export default {
3534
this.$site,
3635
this.$localePath
3736
)
37+
},
38+
homeCom () {
39+
const { type } = this.$themeConfig
40+
if (type !== undefined) {
41+
return type == 'blog' ? 'HomeBlog': type
42+
}
43+
return 'Home'
3844
}
3945
}
4046
}

0 commit comments

Comments
 (0)