|
|
@@ -103,7 +103,7 @@
|
|
|
|
|
|
<!-- 食材列表 -->
|
|
|
<view class="food-list" v-if="currentView === 'personal'">
|
|
|
- <view class="food-card" v-for="(item, idx) in filteredFoods" :key="item.id || idx">
|
|
|
+ <view class="food-card" v-for="(item, idx) in filteredFoods" :key="getFoodKey(item, idx)">
|
|
|
<view class="food-left">
|
|
|
<view class="ingredient-badge" :class="item.scoreClass">
|
|
|
<text class="ingredient-badge-text">{{ idx + 1 }}</text>
|
|
|
@@ -222,6 +222,9 @@ export default {
|
|
|
this.loadFamilyData()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getFoodKey: function(item, idx) {
|
|
|
+ return item.id || idx
|
|
|
+ },
|
|
|
goBack: function() {
|
|
|
uni.navigateBack()
|
|
|
},
|