element-plus Upload组件加了v-model属性导致本地图片能回显,在服务器上图片不能回显问题

场景:使用upload组件,调用后端上传图片接口,将接口返回的图片路径放到 el-image 中实现回显

问题:在开发环境调试过程中,图片可正常回显。代码部署到线上环境服务器后,上传成功,返回的图片路径在浏览器可正常打开,但就是无法回显图片

代码:

父组件代码

<imgUpload :size="1024*5" :fileList="TData.fileList" />

<script setup lang="ts">
import imgUpload from '../components/imgUpload/index.vue'

const TData=reactive({
    fileList:[] as any[],
})

async function httpRequest(v:any){
    const newForm = new FormData()
    newForm.append('file',v.file)
    const {data,code} = await oosImgUpload(newForm)
    if(code==200){
        ElMessage({
            type:"success",
            message:'上传成功'
        })
        const {ossId,fileName,url,prefixPath} = data
        cooperateFormData.feiles.push({
            "photoFile":url+"\\"+fileName,
            "ossId":ossId,
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值