feat: 修复Img组件在错误状态下可以预览的问题

This commit is contained in:
gouzi 2025-01-13 23:50:58 +08:00 committed by GitHub
parent 38363097a5
commit dbd2c85b83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,3 +1,11 @@
<!--
* @Author: 810505339
* @Date: 2024-09-25 11:30:46
* @LastEditors: 810505339
* @LastEditTime: 2025-01-09 11:37:45
* @FilePath: \wot-design-uni\src\uni_modules\wot-design-uni\components\wd-img\wd-img.vue
* 记得注释
-->
<template>
<view :class="rootClass" @click="handleClick" :style="rootStyle">
<image
@ -63,7 +71,7 @@ function handleError(event: any) {
emit('error', event)
}
function handleClick(event: MouseEvent) {
if (props.enablePreview && props.src) {
if (props.enablePreview && props.src && status.value == 'success') {
uni.previewImage({
urls: [props.src]
})