Browse Source

修改图片显示

zs 11 months ago
parent
commit
01b03187d2

+ 6 - 1
src/views/company/detail.vue

@@ -11,7 +11,11 @@
                   v-if="info.logo && info.logo.length > 0"
                   :src="getUrl(info.logo)"
                   fit="fill"
-                />
+                >
+                  <template v-slot:error>
+                    <el-image class="image" :src="match" fit="fill" />
+                  </template>
+                </el-image>
               </el-col>
               <el-col :span="20" class="right">
                 <el-col :span="24" class="right_1">
@@ -137,6 +141,7 @@
 </template>
 
 <script setup>
+import match from '/images/match.jpg'
 // 基础
 import moment from 'moment'
 import { get } from 'lodash-es'

+ 6 - 1
src/views/company/index.vue

@@ -197,7 +197,11 @@
               @click="toView(item)"
             >
               <el-col :span="4" class="left">
-                <el-image class="image" :src="getUrl(item.logo)" fit="fill" />
+                <el-image class="image" :src="getUrl(item.logo)" fit="fill">
+                  <template v-slot:error>
+                    <el-image class="image" :src="match" fit="fill" />
+                  </template>
+                </el-image>
               </el-col>
               <el-col :span="20" class="right">
                 <el-col :span="24" class="right_1">
@@ -253,6 +257,7 @@
 </template>
 
 <script setup>
+import match from '/images/match.jpg'
 import moment from 'moment'
 // API 引用
 import { getCity } from '@/utils/city'

+ 6 - 1
src/views/home/index.vue

@@ -165,7 +165,11 @@
                 @click="toView(item, '2')"
               >
                 <el-col :span="4" class="left">
-                  <el-image class="image" :src="getUrl(item.logo)" fit="fill" />
+                  <el-image class="image" :src="getUrl(item.logo)" fit="fill">
+                    <template v-slot:error>
+                      <el-image class="image" :src="match" fit="fill" />
+                    </template>
+                  </el-image>
                 </el-col>
                 <el-col :span="20" class="right">
                   <el-col :span="24" class="right_1">
@@ -262,6 +266,7 @@
 </template>
 
 <script setup>
+import match from '/images/match.jpg'
 import moment from 'moment'
 const $checkRes = inject('$checkRes')
 import { get } from 'lodash-es'

+ 6 - 1
src/views/innovation/detail.vue

@@ -11,7 +11,11 @@
                   class="image"
                   :src="getUrl(info.file)"
                   fit="fill"
-                />
+                >
+                  <template v-slot:error>
+                    <el-image class="image" :src="match" fit="fill" />
+                  </template>
+                </el-image>
                 <el-image v-else class="image" :src="news" fit="fill" />
               </el-col>
               <el-col :span="18" class="right">
@@ -143,6 +147,7 @@
 </template>
 
 <script setup>
+import match from '/images/match.jpg'
 import moment from 'moment'
 import { get, cloneDeep } from 'lodash-es'
 const $checkRes = inject('$checkRes')

+ 5 - 1
src/views/innovation/index.vue

@@ -116,7 +116,11 @@
                   class="image"
                   :src="getUrl(item.file)"
                   fit="fill"
-                />
+                >
+                  <template v-slot:error>
+                    <el-image class="image" :src="innovation" fit="fill" />
+                  </template>
+                </el-image>
                 <el-image v-else class="image" :src="news" fit="fill" />
               </el-col>
               <el-col :span="20" class="right">

+ 5 - 1
src/views/main/one.vue

@@ -146,7 +146,11 @@
                     class="image"
                     :src="getUrl(item.file)"
                     fit="cover"
-                  />
+                  >
+                    <template v-slot:error>
+                      <el-image class="image" :src="match" fit="fill" />
+                    </template>
+                  </el-image>
                   <el-image v-else class="image" :src="match" fit="fill" />
                   <div class="name">
                     {{ item.name }}