瀏覽代碼

```
fix(video-rights): 修复视频数据列表渲染时的key值错误

当视频数据项的id为null或undefined时,避免Vue渲染警告,
通过使用可选链操作符确保key值的安全访问
```

zouzexu 1 天之前
父節點
當前提交
7e5fb2f336
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/subPack-videoRights/commonTab/components/home.vue

+ 1 - 1
src/subPack-videoRights/commonTab/components/home.vue

@@ -56,7 +56,7 @@ function clearSearch() {
     <view class="box-border px24rpx">
       <scroll-view scroll-y type="custom">
         <grid-view type="masonry" cross-axis-count="2" main-axis-gap="10" cross-axis-gap="10">
-          <view v-for="item in videoDataList" :key="item.id" class="mt-18rpx rounded-16rpx bg-#FFF" @click="router.push({ name: 'video-rights-detail', params: { id: item.id } })">
+          <view v-for="item in videoDataList" :key="item?.id" class="mt-18rpx rounded-16rpx bg-#FFF" @click="router.push({ name: 'video-rights-detail', params: { id: item.id } })">
             <view>
               <image
                 class="h-342rpx w-342rpx rounded-16rpx"