feat: fix comments
Add front-matter information processing about comments.
This commit is contained in:
parent
a2949dc88b
commit
bbdca200ab
@ -30,7 +30,7 @@
|
||||
<Password v-if="!isHasPageKey" :isPage="true"></Password>
|
||||
<div v-else>
|
||||
<slot></slot>
|
||||
<Comments :isShowComments="isComment"/>
|
||||
<Comments :isShowComments="isShow"/>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
@ -48,7 +48,16 @@ import { setTimeout } from 'timers'
|
||||
export default {
|
||||
components: { Sidebar, Navbar, Password },
|
||||
|
||||
props: ['sidebar', 'isComment'],
|
||||
props: {
|
||||
sidebar: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isComment: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
@ -60,6 +69,11 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
// 是否显示评论
|
||||
isShow () {
|
||||
const { isShowComments, home } = this.$frontmatter
|
||||
return !(this.isComment == false || isShowComments == false || home == true)
|
||||
},
|
||||
shouldShowNavbar () {
|
||||
const { themeConfig } = this.$site
|
||||
const { frontmatter } = this.$page
|
||||
|
@ -31,7 +31,7 @@
|
||||
"@vuepress-reco/vuepress-plugin-pagation": "^1.0.3",
|
||||
"@vuepress-reco/vuepress-plugin-screenfull": "^1.0.0",
|
||||
"@vuepress-reco/vuepress-plugin-ga": "^1.0.2",
|
||||
"@vuepress-reco/vuepress-plugin-comments": "^1.0.4",
|
||||
"@vuepress-reco/vuepress-plugin-comments": "^1.0.5",
|
||||
"@vuepress/plugin-medium-zoom": "1.2.0",
|
||||
"@vuepress/plugin-blog": "1.3.0",
|
||||
"leancloud-storage": "3.13.2",
|
||||
|
Loading…
Reference in New Issue
Block a user