mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-24 16:27:23 +08:00
feat: 去除无用代码
This commit is contained in:
@@ -99,7 +99,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="sortedDonors.length > 8" class="expand-button">
|
<div v-if="donors.length > 8" class="expand-button">
|
||||||
<n-button text @click="toggleExpand">
|
<n-button text @click="toggleExpand">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<i :class="isExpanded ? 'ri-arrow-up-s-line' : 'ri-arrow-down-s-line'"></i>
|
<i :class="isExpanded ? 'ri-arrow-up-s-line' : 'ri-arrow-down-s-line'"></i>
|
||||||
@@ -150,18 +150,13 @@ onActivated(() => {
|
|||||||
fetchDonors();
|
fetchDonors();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 只按金额排序的捐赠列表
|
|
||||||
const sortedDonors = computed(() => {
|
|
||||||
return [...donors.value].sort((a, b) => b.amount - a.amount);
|
|
||||||
});
|
|
||||||
|
|
||||||
const isExpanded = ref(false);
|
const isExpanded = ref(false);
|
||||||
|
|
||||||
const displayDonors = computed(() => {
|
const displayDonors = computed(() => {
|
||||||
if (isExpanded.value) {
|
if (isExpanded.value) {
|
||||||
return sortedDonors.value;
|
return donors.value;
|
||||||
}
|
}
|
||||||
return sortedDonors.value.slice(0, 8);
|
return donors.value.slice(0, 8);
|
||||||
});
|
});
|
||||||
|
|
||||||
const toggleExpand = () => {
|
const toggleExpand = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user