mirror of https://github.com/halo-dev/halo
feat: add cover for post list in uc (#7534)
#### What type of PR is this? /area ui /kind improvement /milestone 2.21.x #### What this PR does / why we need it: Add cover image display for the post list in the uc. #### Does this PR introduce a user-facing change? ```release-note None ```pull/7535/head
parent
6f769b0c59
commit
2cba28d21d
|
@ -4,6 +4,7 @@ import HasPermission from "@/components/permission/HasPermission.vue";
|
||||||
import PostContributorList from "@/components/user/PostContributorList.vue";
|
import PostContributorList from "@/components/user/PostContributorList.vue";
|
||||||
import { postLabels } from "@/constants/labels";
|
import { postLabels } from "@/constants/labels";
|
||||||
import { formatDatetime, relativeTimeTo } from "@/utils/date";
|
import { formatDatetime, relativeTimeTo } from "@/utils/date";
|
||||||
|
import { generateThumbnailUrl } from "@/utils/thumbnail";
|
||||||
import PostTag from "@console/modules/contents/posts/tags/components/PostTag.vue";
|
import PostTag from "@console/modules/contents/posts/tags/components/PostTag.vue";
|
||||||
import type { ListedPost } from "@halo-dev/api-client";
|
import type { ListedPost } from "@halo-dev/api-client";
|
||||||
import { ucApiClient } from "@halo-dev/api-client";
|
import { ucApiClient } from "@halo-dev/api-client";
|
||||||
|
@ -121,6 +122,16 @@ function handleDelete() {
|
||||||
<template>
|
<template>
|
||||||
<VEntity>
|
<VEntity>
|
||||||
<template #start>
|
<template #start>
|
||||||
|
<VEntityField v-if="post.post.spec.cover">
|
||||||
|
<template #description>
|
||||||
|
<div class="aspect-h-2 rounded-md overflow-hidden aspect-w-3 w-20">
|
||||||
|
<img
|
||||||
|
class="object-cover w-full h-full"
|
||||||
|
:src="generateThumbnailUrl(post.post.spec.cover, 's')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</VEntityField>
|
||||||
<VEntityField
|
<VEntityField
|
||||||
:title="post.post.spec.title"
|
:title="post.post.spec.title"
|
||||||
:route="{
|
:route="{
|
||||||
|
|
Loading…
Reference in New Issue