From a82d2fb4ca10a14f7f43df325f2bcbcb015f5802 Mon Sep 17 00:00:00 2001 From: yi-ge Date: Wed, 15 Jul 2020 15:44:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=9C=8B=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E7=82=B9=E5=BC=80?= =?UTF-8?q?=E5=B7=A6=E8=BE=B9=E4=BE=A7=E8=BE=B9=E6=A0=8F=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E7=9A=84=E5=9C=B0=E6=96=B9=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/common.styl | 3 ++- layouts/default.vue | 11 ++++++++--- pages/post/_id.vue | 19 +++++++++++++++++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/layouts/common.styl b/layouts/common.styl index 4b9614f..e7a3856 100644 --- a/layouts/common.styl +++ b/layouts/common.styl @@ -150,6 +150,7 @@ footer .footer height 100% width 295px float left + box-shadow 8px 0px 11px 0px #fff #rightContent margin-left 300px @@ -531,7 +532,7 @@ input:-moz-placeholder padding-top 6px cursor pointer - #leftBackgroundColor, #LeftMenu + #LeftMenu display none #rightContent diff --git a/layouts/default.vue b/layouts/default.vue index 311330a..9d90212 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -19,7 +19,7 @@ .page-container #LeftMenu(:style="'display: '+ showLeftMenuValue + ';' + isPhone") LeftContent - #rightContent(@click='showLeftMenu(false)') + #rightContent(@click='hiddenLeftMenu') nuxt Footer v-dialog @@ -61,12 +61,17 @@ export default { } }, methods: { - showLeftMenu (show) { - if (this.showLeftMenuValue === 'block' || show === false) { + showLeftMenu () { + if (this.showLeftMenuValue === 'block') { this.showLeftMenuValue = 'none' } else { this.showLeftMenuValue = 'block' } + }, + hiddenLeftMenu () { + if (document.body.clientWidth < 768) { + this.showLeftMenuValue = 'none' + } } } } diff --git a/pages/post/_id.vue b/pages/post/_id.vue index 644d1cb..acc32ac 100644 --- a/pages/post/_id.vue +++ b/pages/post/_id.vue @@ -54,12 +54,20 @@ .comment-avatar img(:src="'https://picsum.photos/100/100/?blur=1'") .comment-nickname 张三 - .comment-logout 退出 - .comment-btn 发布 + .comment-logout(@click="commentLogout") 退出 + .comment-btn(@click="commentCommit") 发布 .comment-reply-commit(id="comment-reply-commit", v-show="replyID") .login(v-show="!visitorToken", @click="login") img(src="https://cdn.wyr.me/imgs/GitHub-Login.png") #editor-reply + .comment-toolbar + .comment-no-userinfo(v-if="!visitorToken") 尚未登陆 + .comment-userinfo(v-else) + .comment-avatar + img(:src="'https://picsum.photos/100/100/?blur=1'") + .comment-nickname 张三 + .comment-logout(@click="commentLogout") 退出 + .comment-btn(@click="commentCommit") 发布 ins.adsbygoogle(style="display:block; text-align:center; margin-top:20px;", data-ad-layout="in-article", data-ad-format="fluid", data-ad-client="ca-pub-2143583075951360", data-ad-slot="4741804954") .articelRightToc(v-show="articels.post_toc_show && showRightToc", @click="articelRightTocClick") .articelTitle 目录 @@ -440,6 +448,13 @@ export default { }) } }, + commentCommit () { + + }, + commentLogout () { + window.localStorage.visitorToken = null + this.visitorToken = null + }, login () { window.open('https://github.com/login/oauth/authorize?client_id=ce1673a37333e47e482d&redirect_uri=https://www.wyr.me/auth', 'Github授权', 'scrollbars=yes,resizable=yes,status=no,location=yes,toolbar=no,menubar=no,width=800,height=600,left=0,top=0') }