fix: 添加可选链以防止访问未定义的缩略图属性
This commit is contained in:
@@ -87,7 +87,7 @@ function handleDownloadAttachment(url: string, filename: string) {
|
||||
|
||||
<!-- 缩略图 -->
|
||||
<div v-if="data.thumbnailId" class="my-6 rounded-xl overflow-hidden shadow-sm dark:shadow-md">
|
||||
<img :src="data.thumbnail.publicUrl" :alt="data.title" class="w-full h-auto block">
|
||||
<img :src="data.thumbnail?.publicUrl" :alt="data.title" class="w-full h-auto block">
|
||||
</div>
|
||||
|
||||
<!-- 正文内容 -->
|
||||
|
||||
@@ -32,7 +32,7 @@ function openNewsDetail(item: NewData) {
|
||||
class="flex gap-3 p-3 rounded-lg bg-(--ion-color-faint) transition-colors cursor-pointer"
|
||||
@click="openNewsDetail(item)"
|
||||
>
|
||||
<div class="shrink-0">
|
||||
<div v-if="item.thumbnailId" class="shrink-0">
|
||||
<img
|
||||
:src="item.thumbnail.publicUrl"
|
||||
:alt="item.title"
|
||||
|
||||
Reference in New Issue
Block a user