add: 评论功能
This commit is contained in:
parent
3bba510ae0
commit
f248fa1d11
10
.vscode/settings.json
vendored
Normal file
10
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"cSpell.words": [
|
||||||
|
"Weibo",
|
||||||
|
"Weixin",
|
||||||
|
"consola",
|
||||||
|
"fontawesome",
|
||||||
|
"fortawesome",
|
||||||
|
"nuxt"
|
||||||
|
]
|
||||||
|
}
|
@ -5,5 +5,5 @@
|
|||||||
nuxt
|
nuxt
|
||||||
footer
|
footer
|
||||||
.footer
|
.footer
|
||||||
| Copyright © 2018 WangYi. All Rights Reserved.
|
| Copyright © 2020 WangYi. All Rights Reserved.
|
||||||
</template>
|
</template>
|
||||||
|
@ -25,7 +25,7 @@ div
|
|||||||
.articelTitle 目录
|
.articelTitle 目录
|
||||||
.articelTocList(v-html="Articels.post_toc")
|
.articelTocList(v-html="Articels.post_toc")
|
||||||
p(style="margin: 15px 0;")
|
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 联系我。
|
p(style="margin: 15px 0;") 评论功能已被暂时关闭,请通过 a@wyr.me 联系我。
|
||||||
nuxt-link(:to="Articels.last ? '/post/' + Articels.last.ID : ''")
|
nuxt-link(:to="Articels.last ? '/post/' + Articels.last.ID : ''")
|
||||||
.btnFooter.btnPrevt(:style="'color: ' + (Articels.last ? '#333' : '#ccc')")
|
.btnFooter.btnPrevt(:style="'color: ' + (Articels.last ? '#333' : '#ccc')")
|
||||||
@ -36,6 +36,8 @@ div
|
|||||||
| 下一篇 {{ Articels.next ? '(' + decodeTitle(Articels.next.post_name) + ')' : ''}}
|
| 下一篇 {{ Articels.next ? '(' + decodeTitle(Articels.next.post_name) + ')' : ''}}
|
||||||
Icon(:icon="['fas', 'chevron-right']")
|
Icon(:icon="['fas', 'chevron-right']")
|
||||||
.comment
|
.comment
|
||||||
|
div(v-for="(item, index) in Comments" :key="index")
|
||||||
|
| {{ item.comment_content }}
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -54,8 +56,14 @@ export default {
|
|||||||
result.postmetum.meta_value = 0
|
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 {
|
return {
|
||||||
Articels: result,
|
Articels: result,
|
||||||
|
Comments: comments,
|
||||||
showRightToc: false,
|
showRightToc: false,
|
||||||
tocIds: result.post_toc_ids
|
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: {
|
methods: {
|
||||||
decodeTitle (name) {
|
decodeTitle (name) {
|
||||||
|
Loading…
Reference in New Issue
Block a user