Skip to content

Image 图片

Basic · Display component

Image loading and error placeholders.

On-demand importwbbb-ui/components/image

Basic Usage

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

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

States and Interaction

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

SuccessLoadingLoad failedEmpty source

API Reference

Props

PropertyDescriptionTypeDefaultRequired
errorTextSets the default message shown after a loading failure.string'图片加载失败'No
heightSets the component height.WbbbNumeric''No
lazyLoadDefers image loading until it is needed.booleantrueNo
modeSets the display or image fitting mode.string'aspectFill'No
radiusSets the corner radius of the component.WbbbNumeric0No
showErrorControls whether the built-in error placeholder is shown.booleantrueNo
showLoadingControls whether the built-in loading placeholder is shown.booleantrueNo
srcSets the source URL or local path of the resource.string''No
loadingShows a loading state and blocks repeated interaction when applicable.booleanfalseNo
loadingTextSets the text displayed while loading.string'加载中'No
widthSets the component width.WbbbNumeric'100%'No

Events

  • error
  • load

Slots

  • error

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