Hi FE !
Ai
git
前端面试题
前端小tip
  • vite
  • webpack
npm
  • vue2
  • vue3
react
GitHub
Ai
git
前端面试题
前端小tip
  • vite
  • webpack
npm
  • vue2
  • vue3
react
GitHub
  • 上传图片传自定义参数

上传图片传自定义参数


<el-form-item label="上传促销页顶图">
    <el-upload
        class="avatar-uploader"
        v-loading="loading"
        :action="uploadUrl"
        :show-file-list="false"
        :on-success="handleAvatarSuccess1.bind(this,index)"
        :before-upload="beforeAvatarUpload"
        >
        <img v-if="item.shelves_img" :src="item.shelves_img" class="pic" />
        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
    </el-upload>
    <el-dialog :visible.sync="dialogImageVisible">
        <img width="100%" :src="dialogImageUrl" alt />
    </el-dialog>
</el-form-item>

handleAvatarSuccess1(index,res, file) {
     console.log("成功",index,res, file)
   this.loading = false;
   this.newArr[index].shelves_img = res.data.picurl
 //   this.$set(this.form, "pic", res.data.picurl);
 },
 
Edit this page
最近更新: 2025/12/2 01:46
Contributors: qdleader
qdleader
本站总访问量 129823次 | 本站访客数 12人