优化首页账号展示体验
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import type { Listing } from '@/features/listings'
|
||||
import {
|
||||
@@ -24,18 +25,19 @@ interface Props {
|
||||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
|
||||
const coverURL = computed(() => props.listing.cover_url || props.listing.screenshot_urls?.[0] || '')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<RouterLink class="listing-card-v2" :to="`/listings/${listing.id}`">
|
||||
<div class="card-cover">
|
||||
<img
|
||||
v-if="listing.cover_url"
|
||||
:data-src="listing.cover_url"
|
||||
v-if="coverURL"
|
||||
:src="coverURL"
|
||||
:alt="getListingTitle(listing)"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
class="lazy-image"
|
||||
/>
|
||||
<div v-else class="empty-cover">HFB</div>
|
||||
<div class="cover-badges">
|
||||
|
||||
Reference in New Issue
Block a user