mirror of https://github.com/halo-dev/halo-admin
Support turn to posts list page by category. (#66)
parent
0d6ebd0733
commit
965e221301
|
@ -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 } })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue