From f248fa1d11a83389ddfde7dc57a0c39142f9aaf4 Mon Sep 17 00:00:00 2001 From: yi-ge Date: Mon, 6 Jul 2020 18:13:28 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E8=AF=84=E8=AE=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 10 ++++++++++ layouts/errorTheme.vue | 2 +- pages/post/_id.vue | 14 ++++++++++++-- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..62f02f1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "cSpell.words": [ + "Weibo", + "Weixin", + "consola", + "fontawesome", + "fortawesome", + "nuxt" + ] +} \ No newline at end of file diff --git a/layouts/errorTheme.vue b/layouts/errorTheme.vue index 35a8a01..151be98 100644 --- a/layouts/errorTheme.vue +++ b/layouts/errorTheme.vue @@ -5,5 +5,5 @@ nuxt footer .footer - | Copyright © 2018 WangYi. All Rights Reserved. + | Copyright © 2020 WangYi. All Rights Reserved. diff --git a/pages/post/_id.vue b/pages/post/_id.vue index 834117e..14ae2a8 100644 --- a/pages/post/_id.vue +++ b/pages/post/_id.vue @@ -25,7 +25,7 @@ div .articelTitle 目录 .articelTocList(v-html="Articels.post_toc") p(style="margin: 15px 0;") - img(src="https://cdn.wyr.me/imgs/reward.jpg" style="width: 100%") + img(src="https://cdn.wyr.me/imgs/reward.jpg" style="max-width: 100%; width: 200px") p(style="margin: 15px 0;") 评论功能已被暂时关闭,请通过 a@wyr.me 联系我。 nuxt-link(:to="Articels.last ? '/post/' + Articels.last.ID : ''") .btnFooter.btnPrevt(:style="'color: ' + (Articels.last ? '#333' : '#ccc')") @@ -36,6 +36,8 @@ div | 下一篇 {{ Articels.next ? '(' + decodeTitle(Articels.next.post_name) + ')' : ''}}   Icon(:icon="['fas', 'chevron-right']") .comment + div(v-for="(item, index) in Comments" :key="index") + | {{ item.comment_content }} @@ -54,8 +56,14 @@ export default { result.postmetum.meta_value = 0 } + // 获取评论 + const tmp = await $axios.$get(`/public/comments/post?ID=${route.params.id}`) + const comments = tmp.result + console.log(comments) + return { Articels: result, + Comments: comments, showRightToc: false, tocIds: result.post_toc_ids } @@ -133,7 +141,9 @@ export default { } } - (adsbygoogle = window.adsbygoogle || []).push({}) // eslint-disable-line + try { + (adsbygoogle = window.adsbygoogle || []).push({}) // eslint-disable-line + } catch (_) { } }, methods: { decodeTitle (name) {