diff --git a/components/Common.vue b/components/Common.vue index fc9f8a7..0e9a191 100644 --- a/components/Common.vue +++ b/components/Common.vue @@ -30,7 +30,7 @@
- +
@@ -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 diff --git a/package.json b/package.json index a20fbdd..4b287b8 100644 --- a/package.json +++ b/package.json @@ -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",