feat:增加后端接口

This commit is contained in:
2025-06-24 23:34:00 +08:00
parent 69c0bfa4c7
commit 71c107f2e5
17 changed files with 141 additions and 191 deletions

View File

@@ -2,8 +2,8 @@
<div v-for="(item, index) in foodRankList.slice(0, MAX_RANK_COUNT)"
:key="index" class="rank-item">
<span class="rank-index">{{ index+1 }}.</span>
<span class="rank-content">{{ item.value }}</span>
<span class="rank-amount">{{ item.count }} </span>
<span class="rank-content">{{ item.name }}</span>
<span class="rank-amount">{{ item.value }} </span>
</div>
</template>
@@ -15,19 +15,5 @@ const foodStore = useFoodStore()
const MAX_RANK_COUNT = 10
const foodRankList = computed(() => {
return [{
value: '红烧肉',
count: 10
}, {
value: '红烧鱼',
count: 8
}, {
value: '排骨汤',
count: 5
}, {
value: '红烧带鱼',
count: 2
}]
})
const foodRankList = computed(() => foodStore.foodRankStats)
</script>