guhongwei 3 anni fa
parent
commit
90b3243a4b

+ 9 - 2
src/views/twoweb/universal/list/detail-model/news-model.vue

@@ -14,14 +14,14 @@
             <span>发布时间:{{ data.create_time || '暂无' }}</span>
           </p>
         </el-col>
-        <el-col :span="24" class="two" v-if="data.img_url.length > 0">
+        <el-col :span="24" class="two" v-if="data.img_url && data.img_url.length > 0">
           <el-carousel height="300px">
             <el-carousel-item v-for="(item, index) in data.img_url" :key="index">
               <el-image :src="item.url"></el-image>
             </el-carousel-item>
           </el-carousel>
         </el-col>
-        <el-col :span="24" class="thr" v-if="data.file_url.length > 0">
+        <el-col :span="24" class="thr" v-if="data.file_url && data.file_url.length > 0">
           <video :src="getVideo(data.file_url)" controls autoplay loop>
             <source src="movie.mp4" type="video/mp4" />
             <source src="movie.ogg" type="video/ogg" />
@@ -61,6 +61,13 @@ export default {
   metadata() {
     return { title: this.$route.meta.title };
   },
+  watch: {
+    data: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
 };
 </script>