feat: fix comments

Add front-matter information processing about comments.
This commit is contained in:
reco_luan 2019-10-26 00:12:22 +08:00
parent a2949dc88b
commit bbdca200ab
2 changed files with 17 additions and 3 deletions

View File

@ -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

View File

@ -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",