20 lines
1.0 KiB
Plaintext
20 lines
1.0 KiB
Plaintext
<!---------- wxs start ----------->
|
|
<wxs module="utils" src="../wxs/utils.wxs"></wxs>
|
|
<wxs module="computed" src="./index.wxs"></wxs>
|
|
<!---------- wxs end ----------->
|
|
|
|
|
|
|
|
<view style="{{ computed.rootStyle({ width, height, radius }) }}" class="custom-class {{ utils.bem('image', { round })}}" bind:tap="onClick">
|
|
<image wx:if="{{ !error }}" src="{{ src }}" mode="{{ computed.mode(fit) }}" lazy-load="{{ lazyLoad }}" class="image-class van-image__img" show-menu-by-longpress="{{ showMenuByLongpress }}" bind:load="onLoad" bind:error="onError"></image>
|
|
|
|
<view wx:if="{{ loading && showLoading }}" class="loading-class van-image__loading">
|
|
<slot wx:if="{{ useLoadingSlot }}" name="loading"></slot>
|
|
<van-icon wx:else="" name="photo" custom-class="van-image__loading-icon"></van-icon>
|
|
</view>
|
|
<view wx:if="{{ error && showError }}" class="error-class van-image__error">
|
|
<slot wx:if="{{ useErrorSlot }}" name="error"></slot>
|
|
<van-icon wx:else="" name="photo-fail" custom-class="van-image__error-icon"></van-icon>
|
|
</view>
|
|
</view>
|