Parcourir la source

fix(mini): add wx:key to v-for placeholder loop in DimensionArticles

:key="'ph-' + i" is a complex expression uni-app can't compile
to wx:key. Changed to :key="i" which compiles to wx:key="*this",
eliminating the WXML runtime warning.
iwt il y a 3 mois
Parent
commit
c22f0a8e03
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      cfc-frontend/components/DimensionArticles.vue

+ 1 - 1
cfc-frontend/components/DimensionArticles.vue

@@ -7,7 +7,7 @@
     <view class="article-list">
       <!-- 无数据时显示占位卡片 -->
       <template v-if="!displayArticles || displayArticles.length === 0">
-        <view class="article-card" v-for="i in 3" :key="'ph-' + i">
+        <view class="article-card" v-for="i in 3" :key="i">
           <view class="article-category" :style="{ background: colors[(i-1) % colors.length] }">
             <text class="article-category-text">推荐文章</text>
           </view>