From fd98d3d9d49fad8d7244cae8de2264a635fe9f69 Mon Sep 17 00:00:00 2001
From: long <515897141@qq.com>
Date: 星期一, 28 二月 2022 15:55:38 +0800
Subject: [PATCH] 补充默认头像svg、添加加载失败图片显示(demo/list)

---
 src/icons/svg/avatar.svg    |    2 ++
 src/pages/demo/list.vue     |   11 +++++++++++
 src/pages/system/banner.vue |    7 ++++++-
 3 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/src/icons/svg/avatar.svg b/src/icons/svg/avatar.svg
new file mode 100644
index 0000000..360c116
--- /dev/null
+++ b/src/icons/svg/avatar.svg
@@ -0,0 +1,2 @@
+
+<svg t="1646034217365" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2353" width="60" height="60"><path d="M512 73.142857c242.358857 0 438.857143 196.498286 438.857143 438.857143s-196.498286 438.857143-438.857143 438.857143S73.142857 754.358857 73.142857 512 269.641143 73.142857 512 73.142857m0-73.142857C229.229714 0 0 229.229714 0 512s229.229714 512 512 512 512-229.229714 512-512S794.770286 0 512 0z" p-id="2354"></path><path d="M659.748571 548.571429H369.371429c-81.371429 1.097143-146.688 74.605714-146.285715 164.608v148.406857c165.558857 167.789714 419.620571 167.789714 585.142857 0v-149.613715c0.402286-43.593143-15.140571-85.577143-43.081142-116.297142-27.977143-30.756571-65.974857-47.725714-105.398858-47.067429z" p-id="2355"></path><path d="M515.657143 338.651429m-146.285714 0a146.285714 146.285714 0 1 0 292.571428 0 146.285714 146.285714 0 1 0-292.571428 0Z" p-id="2356"></path></svg>
\ No newline at end of file
diff --git a/src/pages/demo/list.vue b/src/pages/demo/list.vue
index 29305d0..c6010f2 100644
--- a/src/pages/demo/list.vue
+++ b/src/pages/demo/list.vue
@@ -72,11 +72,22 @@
         <template slot-scope="scope">
           <el-image :src="scope.row.headImg" style="width:50px;height:50px;" fit="contain" :preview-src-list="[scope.row.headImg]">
             <div slot="error" class="image-slot">
+              <!-- 榛樿澶村儚 -->
               <svg-icon icon-class="avatar" style="width:50px;height:50px;" />
             </div>
           </el-image>
         </template>
       </el-table-column>
+      <el-table-column label="鍥剧墖" prop="headImg" align="center" min-width="100">
+        <template slot-scope="scope">
+          <el-image :src="scope.row.headImg" style="width:50px;height:50px;" fit="contain" :preview-src-list="[scope.row.headImg]">
+            <div slot="error" class="image-slot">
+              <!-- 鍥剧墖鏄剧ず澶辫触鍥炬爣 -->
+              <img src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png" style="width:50px;height:50px;">
+            </div>
+          </el-image>
+        </template>
+      </el-table-column>
       <el-table-column label="瑙掕壊鍚嶇О" prop="name" align="center" min-width="120" />
       <el-table-column label="鍗曡鐪佺暐" show-overflow-tooltip prop="adviceInfo" align="center" min-width="120" />
       <el-table-column label="澶氳鐪佺暐" prop="adviceInfo" align="center" min-width="160">
diff --git a/src/pages/system/banner.vue b/src/pages/system/banner.vue
index 9b55b29..9cfe56e 100644
--- a/src/pages/system/banner.vue
+++ b/src/pages/system/banner.vue
@@ -19,7 +19,12 @@
       <el-table-column type="index" label="搴忓彿" align="center" width="60" />
       <el-table-column label="鍥剧墖" prop="imgUrl" align="center" min-width="120">
         <template slot-scope="scope">
-          <el-image :src="scope.row.imgUrl" style="width:80px;height:80px" fit="contain" :preview-src-list="[scope.row.imgUrl]" />
+          <el-image :src="scope.row.imgUrl" style="width:80px;height:80px" fit="contain" :preview-src-list="[scope.row.imgUrl]">
+            <div slot="error" class="image-slot">
+              <!-- 鍥剧墖鏄剧ず澶辫触鍥炬爣 -->
+              <img src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png" style="width:80px;height:80px">
+            </div>
+          </el-image>
         </template>
       </el-table-column>
       <el-table-column prop="jumpType" label="璺宠浆绫诲瀷" align="center" min-width="120">

--
Gitblit v1.8.0