Browse Source

item-card.vue 条件渲染用户路由

reghao 3 năm trước cách đây
mục cha
commit
e0af0b4fe6
2 tập tin đã thay đổi với 3 bổ sung4 xóa
  1. 3 3
      src/components/item-card.vue
  2. 0 1
      src/views/user/home.vue

+ 3 - 3
src/components/item-card.vue

@@ -10,7 +10,7 @@
     </router-link>
     <v-row>
       <v-col cols="2">
-        <router-link :to="`/u/${videoInfo.userId}`">
+        <router-link v-if="videoInfo.userId !== null" :to="`/u/${videoInfo.userId}`">
           <v-avatar size="48">
             <v-img :src="videoInfo.avatarUrl" />
           </v-avatar>
@@ -21,10 +21,10 @@
           <router-link :to="`/video/${videoInfo.videoId}`" style="color: black;"> {{ videoInfo.title }} </router-link>
         </p>
         <p style="font-size: 10px; color: #606060;">
-          <router-link :to="`/u/${videoInfo.userId}`"> {{ videoInfo.username }}</router-link>
+          <router-link v-if="videoInfo.userId !== null" :to="`/u/${videoInfo.userId}`"> {{ videoInfo.username }}</router-link>
           <br>
           {{ videoInfo.viewCount }} 观看 <span v-html="`&nbsp;&nbsp;`" />
-          <span v-text="TimeUtil.timeToNowStrning(videoInfo.pubDate)" />
+          <span v-text="TimeUtil.timeToNowStrning(videoInfo.pubDate)"></span>
         </p>
       </v-col>
     </v-row>

+ 0 - 1
src/views/user/home.vue

@@ -114,7 +114,6 @@
 import { userVideoList } from '@/api/media/video'
 import { getUserInfo } from '@/api/user/account'
 import Power from '@/utils/check-power.vue'
-/* import VideoList from '@/components/player/video-card.vue'*/
 import ItemCard from '@/components/item-card.vue'
 import TimeUtil from '@/utils/time-util.vue'