1
jhzh
2025-04-20 d157d0892f1ab5517dbe3a08328ccb9c4e446615
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<wxs src="../wxs/utils.wxs" module="utils" />
 
<view
  style="{{ viewStyle }}"
  class="custom-class {{ utils.bem('image', { round })}}"
  bind:tap="onClick"
>
  <image
    wx:if="{{ !error }}"
    src="{{ src }}"
    mode="{{ mode }}"
    lazy-load="{{ lazyLoad }}"
    class="image-class van-image__img"
    show-menu-by-longpress="{{ showMenuByLongpress }}"
    bind:load="onLoad"
    bind:error="onError"
  />
 
  <view
    wx:if="{{ loading && showLoading }}"
    class="loading-class van-image__loading"
  >
    <slot wx:if="{{ useLoadingSlot }}" name="loading" />
    <van-icon wx:else name="photo-o" size="22" />
  </view>
  <view
    wx:if="{{ error && showError }}"
    class="error-class van-image__error"
  >
    <slot wx:if="{{ useErrorSlot }}" name="error" />
    <van-icon wx:else name="warning-o" size="22" />
  </view>
</view>