2、el-image设置error图像

发布时间 2023-12-01 16:56:50作者: zhaogaojian

注意和2.0不同

 <el-table-column label="人脸图像" align="center" prop="imageUrl" width="200px">
        <template #default="scope">
          <el-image :src=getImgUrl(scope.row.imageUrl) preview-teleported="true"  fit="cover"
            :preview-src-list=[getImgUrl(scope.row.imageUrl)] alt="Description" style="width: 100px; height: 100px;">
              <template #error>
                <div class="image-slot" >
                  <el-icon style="width: 100px; height: 100px;font-size: 100px;color:lightgray"><picture-filled /></el-icon>
                </div>
              </template>
            </el-image>
        </template>

image