vue+elementUI图片预览 el-image 的使用

本文转载自 https://www.cnblogs.com/allanlau/p/13397625.html
首页定义data:

data() {
  return {
  imgs: "",
  imgsVisible: false //默认弹窗属性是隐藏的
    }
}
<el-dialog title="图片查看" :visible.sync="imgsVisible" width="40%">
      <div style="  display: flex;justify-content: center;">
        <el-image :src="imgs" fit="scale-down" lazy style="margin: 20px auto;">
          <div slot="error" class="image-slot">
            <i class="el-icon-picture-outline"></i>
          </div>
        </el-image>
      </div>
      <div style=" display: flex;justify-content: center;">
        <el-button  @click="imgsVisible = false" type="primary" style="width: 6vw; ">确 定</el-button>
      </div>
 </el-dialog>
Logo

前往低代码交流专区

更多推荐