Element Ui 图片预览,<el-image> 的使用

点击图片,弹出预览弹窗,显示图片
首页定义data:
1.data() {
  return {
  imgs: "",
  imgsVisible: false //默认弹窗属性是隐藏的
    }
}
2.<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>
posted @ 2020-07-29 15:50  AllenLau  阅读(40032)  评论(0编辑  收藏  举报