Files
heroui-vue/apps/docs/demos/card-with-avatar.vue
T

78 lines
2.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import {
Card,
CardHeader,
CardTitle,
CardDescription,
CardFooter,
Avatar,
AvatarImage,
AvatarFallback,
} from "@heroui-vue/components";
</script>
<template>
<div class="flex flex-wrap gap-4">
<Card class="w-[200px] gap-2">
<img
alt="独立创客社区"
class="pointer-events-none aspect-square w-14 rounded-2xl object-cover select-none"
loading="lazy"
src="https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/docs/demo1.jpg"
/>
<CardHeader>
<CardTitle>Indie Hackers</CardTitle>
<CardDescription>148 位成员</CardDescription>
</CardHeader>
<CardFooter class="flex gap-2">
<Avatar
aria-label="玛莎的头像"
class="inline-flex shrink-0 overflow-hidden rounded-full size-5"
>
<AvatarImage
class="size-full object-cover"
alt="玛莎的头像"
src="https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/avatars/red.jpg"
/>
<AvatarFallback
class="flex size-full items-center justify-center bg-default text-xs"
>
IH
</AvatarFallback>
</Avatar>
<span class="text-xs">创建者:玛莎</span>
</CardFooter>
</Card>
<Card class="w-[200px] gap-2">
<img
alt="AI 开发者社区"
class="pointer-events-none aspect-square w-14 rounded-2xl object-cover select-none"
loading="lazy"
src="https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/docs/demo2.jpg"
/>
<CardHeader>
<CardTitle>AI Builders</CardTitle>
<CardDescription>362 位成员</CardDescription>
</CardHeader>
<CardFooter class="flex gap-2">
<Avatar
aria-label="约翰的头像"
class="inline-flex shrink-0 overflow-hidden rounded-full size-5"
>
<AvatarImage
class="size-full object-cover"
alt="约翰的头像"
src="https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/avatars/blue.jpg"
/>
<AvatarFallback
class="flex size-full items-center justify-center bg-default text-xs"
>
B
</AvatarFallback>
</Avatar>
<span class="text-xs">创建者:约翰</span>
</CardFooter>
</Card>
</div>
</template>