<template>
  <view class="image-wrapper">
    <u-image 
      :showLoading="true"
      v-bind="$props"
      :src="src || 'https://mn.wenlvti.net/app_static/minnan/EmptyImage.png'"
    >
      <template #loading>
        <u-loading-icon color="red"></u-loading-icon>
      </template>
      <template #error>
        <u-empty mode="page" text="图片加载失败" />
      </template>
    </u-image>
  </view>
</template>

<script setup lang="ts">
const props = defineProps({	
  src: {
    type: String,
    required: true,
  },
})
</script>