Support turn to posts list page by category. (#66)

pull/68/head
Ryan Wang 2020-02-17 15:28:49 +08:00 committed by GitHub
parent 0d6ebd0733
commit 965e221301
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 1 deletions

View File

@ -178,6 +178,19 @@
> >
{{ text }} {{ text }}
</ellipsis> </ellipsis>
<span
slot="postCount"
slot-scope="text,record"
style="cursor: pointer;"
@click="handleQueryCategoryPosts(record)"
>
<a-badge
:count="record.postCount"
:numberStyle="{backgroundColor: '#00e0ff'} "
:showZero="true"
:overflowCount="9999"
/>
</span>
<span <span
slot="action" slot="action"
slot-scope="text, record" slot-scope="text, record"
@ -251,7 +264,8 @@ const columns = [
}, },
{ {
title: '文章数', title: '文章数',
dataIndex: 'postCount' dataIndex: 'postCount',
scopedSlots: { customRender: 'postCount' }
}, },
{ {
title: '操作', title: '操作',
@ -342,6 +356,9 @@ export default {
handleSelectThumbnail(data) { handleSelectThumbnail(data) {
this.$set(this.categoryToCreate, 'thumbnail', encodeURI(data.path)) this.$set(this.categoryToCreate, 'thumbnail', encodeURI(data.path))
this.thumbnailDrawerVisible = false this.thumbnailDrawerVisible = false
},
handleQueryCategoryPosts(category) {
this.$router.push({ name: 'PostList', query: { categoryId: category.id } })
} }
} }
} }