Skip to content

Avatar 头像

Basic · Display component

Avatars and fallback placeholders.

On-demand importwbbb-ui/components/avatar

Basic Usage

Example code
<script setup lang="ts">
import { WbbbAvatar } from 'wbbb-ui/components/avatar'
import 'wbbb-ui/styles/avatar'
</script>

<template>
  <WbbbAvatar />
</template>
Live mobile previewOpen in a new tab ↗

States and Interaction

All listed states can be operated and verified in the live Playground preview.

图片Load-failure fallbackInitialsDefault icon

API Reference

Props

PropertyDescriptionTypeDefaultRequired
altProvides alternative text for an image resource.string''No
roundUses fully rounded corners or a pill shape.booleantrueNo
sizeSets the component size.WbbbNumeric80No
srcSets the source URL or local path of the resource.string''No

Events

  • error

Slots

  • default

Two-way binding

Does not support v-model.

Platform Notes

Build verification: H5, App Vue, WeChat Mini Program, Alipay Mini Program, and Douyin Mini Program.

Runtime differences: H5 supports keyboard focus and reduced motion. Mini Programs provide equivalent touch interaction; verify upload, date selection, and overlays on target platforms.

Usage note: Use Playground to verify further state combinations and cross-platform behavior.

Wbbb UI · Built for uni-app product experiences