Skip to content

Commit bcb6bbd

Browse files
author
reco_luan
committed
fix(vuepress-theme-reco): fix valine
1. comment doesn't show when use valine 2. change valine show rules
1 parent 3a2dfe9 commit bcb6bbd

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

packages/vuepress-theme-reco/components/Footer.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<img src="https://img.alicdn.com/tfs/TB1..50QpXXXXX7XpXXXXXXXXXX-40-40.png" alt="">
2626
<a :href="$themeConfig.cyberSecurityLink || '#'">{{ $themeConfig.cyberSecurityRecord }}</a>
2727
</p>
28+
<Comments :isShowComments="false"/>
2829
</div>
2930
</template>
3031

packages/vuepress-theme-reco/components/Page.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,9 @@ export default {
9696
computed: {
9797
// 是否显示评论
9898
shouldShowComments () {
99-
const { isShowComments, home } = this.$frontmatter
100-
return !(
101-
this.isComment == false ||
102-
isShowComments == false ||
103-
home == true
104-
)
99+
const { isShowComments } = this.$frontmatter
100+
const { showComment } = this.$themeConfig.valineConfig || { showComment: true }
101+
return (showComment !== false && isShowComments !== false) || (showComment === false && isShowComments === true)
105102
},
106103
showAccessNumber () {
107104
return this.$themeConfig.valineConfig !== undefined

packages/vuepress-theme-reco/layouts/Layout.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<Common>
33
<component v-if="$frontmatter.home" :is="homeCom"/>
44
<Page v-else :sidebar-items="sidebarItems"/>
5-
<Comments :isShowComments="false"/>
65
<Footer v-if="$frontmatter.home" class="footer" />
76
</Common>
87
</template>

0 commit comments

Comments
 (0)