|
|
@ -10,21 +10,33 @@
|
|
|
|
:key="index"
|
|
|
|
:key="index"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<a-comment :avatar="'//gravatar.loli.net/avatar/'+item.gavatarMd5+'/?s=256&d=mp'">
|
|
|
|
<a-comment :avatar="'//gravatar.loli.net/avatar/'+item.gavatarMd5+'/?s=256&d=mp'">
|
|
|
|
<template slot="author" v-if="type==='posts'">
|
|
|
|
<template
|
|
|
|
{{ item.author }} 发表在 《<a
|
|
|
|
slot="author"
|
|
|
|
href="javascript:void(0);"
|
|
|
|
v-if="type==='posts'"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<a
|
|
|
|
|
|
|
|
:href="item.authorUrl"
|
|
|
|
|
|
|
|
target="_blank"
|
|
|
|
|
|
|
|
>{{ item.author }}</a> 发表在 《<a
|
|
|
|
|
|
|
|
:href="options.blog_url+'/archives/'+item.post.url"
|
|
|
|
target="_blank"
|
|
|
|
target="_blank"
|
|
|
|
>{{ item.post.title }}</a>》
|
|
|
|
>{{ item.post.title }}</a>》
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<template slot="author" v-else-if="type==='sheets'">
|
|
|
|
<template
|
|
|
|
{{ item.author }} 发表在 《<a
|
|
|
|
slot="author"
|
|
|
|
href="javascript:void(0);"
|
|
|
|
v-else-if="type==='sheets'"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<a
|
|
|
|
|
|
|
|
:href="item.authorUrl"
|
|
|
|
|
|
|
|
target="_blank"
|
|
|
|
|
|
|
|
>{{ item.author }}</a> 发表在 《<a
|
|
|
|
|
|
|
|
:href="options.blog_url+'/s/'+item.sheet.url"
|
|
|
|
target="_blank"
|
|
|
|
target="_blank"
|
|
|
|
>{{ item.sheet.title }}</a>》
|
|
|
|
>{{ item.sheet.title }}</a>》
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<template slot="actions">
|
|
|
|
<!-- <template slot="actions">
|
|
|
|
<span>回复</span>
|
|
|
|
<span>回复</span>
|
|
|
|
</template>
|
|
|
|
</template> -->
|
|
|
|
<p
|
|
|
|
<p
|
|
|
|
class="comment-content-wrapper"
|
|
|
|
class="comment-content-wrapper"
|
|
|
|
slot="content"
|
|
|
|
slot="content"
|
|
|
@ -43,6 +55,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import commentApi from '@/api/comment'
|
|
|
|
import commentApi from '@/api/comment'
|
|
|
|
|
|
|
|
import optionApi from '@/api/option'
|
|
|
|
|
|
|
|
|
|
|
|
import marked from 'marked'
|
|
|
|
import marked from 'marked'
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: 'RecentCommentTab',
|
|
|
|
name: 'RecentCommentTab',
|
|
|
@ -59,7 +73,9 @@ export default {
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
comments: [],
|
|
|
|
comments: [],
|
|
|
|
loading: false
|
|
|
|
loading: false,
|
|
|
|
|
|
|
|
options: [],
|
|
|
|
|
|
|
|
keys: ['blog_url']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
@ -72,8 +88,14 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
this.loadComments()
|
|
|
|
this.loadComments()
|
|
|
|
|
|
|
|
this.loadOptions()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
loadOptions() {
|
|
|
|
|
|
|
|
optionApi.listAll(this.keys).then(response => {
|
|
|
|
|
|
|
|
this.options = response.data.data
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
loadComments() {
|
|
|
|
loadComments() {
|
|
|
|
this.loading = true
|
|
|
|
this.loading = true
|
|
|
|
commentApi.latestComment(this.type, 5, 'PUBLISHED').then(response => {
|
|
|
|
commentApi.latestComment(this.type, 5, 'PUBLISHED').then(response => {
|
|
|
|