File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 3030 <Password v-if =" !isHasPageKey" :isPage =" true" ></Password >
3131 <div v-else >
3232 <slot ></slot >
33- <Comments :isShowComments =" isComment " />
33+ <Comments :isShowComments =" isShow " />
3434 </div >
3535 </div >
3636 </transition >
@@ -48,7 +48,16 @@ import { setTimeout } from 'timers'
4848export default {
4949 components: { Sidebar, Navbar, Password },
5050
51- props: [' sidebar' , ' isComment' ],
51+ props: {
52+ sidebar: {
53+ type: Boolean ,
54+ default: false
55+ },
56+ isComment: {
57+ type: Boolean ,
58+ default: true
59+ }
60+ },
5261
5362 data () {
5463 return {
@@ -60,6 +69,11 @@ export default {
6069 },
6170
6271 computed: {
72+ // 是否显示评论
73+ isShow () {
74+ const { isShowComments , home } = this .$frontmatter
75+ return ! (this .isComment == false || isShowComments == false || home == true )
76+ },
6377 shouldShowNavbar () {
6478 const { themeConfig } = this .$site
6579 const { frontmatter } = this .$page
Original file line number Diff line number Diff line change 3131 "@vuepress-reco/vuepress-plugin-pagation" : " ^1.0.3" ,
3232 "@vuepress-reco/vuepress-plugin-screenfull" : " ^1.0.0" ,
3333 "@vuepress-reco/vuepress-plugin-ga" : " ^1.0.2" ,
34- "@vuepress-reco/vuepress-plugin-comments" : " ^1.0.4 " ,
34+ "@vuepress-reco/vuepress-plugin-comments" : " ^1.0.5 " ,
3535 "@vuepress/plugin-medium-zoom" : " 1.2.0" ,
3636 "@vuepress/plugin-blog" : " 1.3.0" ,
3737 "leancloud-storage" : " 3.13.2" ,
You can’t perform that action at this time.
0 commit comments