修改提出的bug

This commit is contained in:
田岩
2025-07-10 21:32:22 +08:00
parent 1cd8914074
commit 45eb464bf6
15 changed files with 268 additions and 195 deletions
@@ -1,5 +1,5 @@
<template>
<image :src="imgUrlShow" fit="cover"></image>
<image :src="imgUrlShow" fit="cover" :mode="mode"></image>
</template>
<script>
@@ -30,7 +30,11 @@
isCache:{
type: Boolean,
default: false
}
},
mode:{
type: String,
default: 'widthFix'
},
},
data() {
return {
@@ -1,7 +1,7 @@
<template>
<view class="components_custom_file_upload_div pic-cell">
<view v-for="(item,index) in fileList" class="img_div pic-item">
<image-preview :imgId="item.fileId" class="img"></image-preview>
<view v-for="(item,index) in fileList" class="img_div pic-item" @click="pic_click(item, index)">
<image-preview :imgId="item.fileId" class="img" mode="aspectFill"></image-preview>
</view>
<view @tap="upload" v-show="show_upload_button">
<view class=" add_icon"></view>
@@ -25,6 +25,14 @@
const show_upload_button = computed(() => {
return !props.readonly && props.limit > fileList.length
})
const pic_click = (item, index) => {
common.show('提示', '是否删除图片' + (index + 1)).then(res => {
if (res) {
fileList.splice(index, 1)
emits('update:modelValue', fileList.map(res => res.fileId))
}
})
}
// 定义props
const props = defineProps({
modelValue: {
@@ -56,19 +64,13 @@
fileId: res
})))
}
// else if ((typeof newVal === "String") && newVal !== '') {
// fileList.push({
// fileId: newVal
// })
// }
}, {
deep: true,
immediate: true
})
// 定义emits
const emits = defineEmits(['update:modelValue'])
onMounted(() => {
})