• elementUI 上传多图


    <el-upload
              :action="$store.state.baseURL+'/commonFile/upload.do'"
              list-type="picture-card"
              :on-success="handleSuccess"
              :on-preview="handlePictureCardPreview"
              :file-list="fileList"
              :on-remove="handleRemove">
           <i class="el-icon-plus"></i>
      </el-upload>
       <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="">
       </el-dialog>
     
     
     
    // 文件上传成功
            handleSuccess(response, file, fileList) {
                console.log(file)
                 console.log(fileList)
                this.fileList = fileList.map(res => {
                    if(res.raw) {
                        return {
                            name: res.name,
                            id: res.response.data,
                            status: res.status,
                            raw: res.raw,
                            url: res.url
                        } 
                    }else {
                        return {
                            name: res.name,
                            id: res.id,
                            status: res.status,
                            url: res.url
                        }
                    }
                })
                console.log(this.fileList)
            },
     
    handlePictureCardPreview(file) {
                console.log(file)
                this.dialogImageUrl = file.url;
                this.dialogVisible = true;
            }
     
     
     handleRemove(file, fileList) {
                console.log(file)
                console.log(fileList)
                this.fileList = fileList;
            },
  • 相关阅读:
    python之redis
    redis 双写一致性问题
    MySQL主从复制与读写分离
    高并发下Redis如何保持数据一致性(避免读后写)
    redis的no-appendfsync-on-rewrite参数
    Redis基础、高级特性与性能调优
    python连接redis sentinel集群
    ListView阻尼效果
    零基础学python-5.6 数字位操作与其它工具
    iOS 实现QQ界面
  • 原文地址:https://www.cnblogs.com/lucy1111/p/13387907.html
Copyright © 2020-2023  润新知