diff --git a/src/views/mine/RankList.vue b/src/views/mine/RankList.vue index de8e18f..7f9e7a0 100644 --- a/src/views/mine/RankList.vue +++ b/src/views/mine/RankList.vue @@ -6,7 +6,7 @@
视频点击量
-
+
我的成绩 @@ -50,25 +50,22 @@ export default defineComponent({ type: Array } }, - setup() { + setup(props) { const deadLine = ref(4); // 写死的合格线 - - function filterData(list: any) { - let mineRank = 0; // 自己的排名 - list.forEach((element: any) => { - if(element.isme) { - mineRank = element.rank; - } - }); - // 过滤数据 - const newList = list.filter((item: any) => { - return item.rank <= 3 || item.rank == deadLine.value || item.rank === mineRank || item.rank === mineRank - 1 || item.rank === mineRank + 1; - }) - return newList; - } + const list = ref(props.list); + let mineRank = 0; // 自己的排名 + list.value!.forEach((element: any) => { + if(element.isme) { + mineRank = element.rank; + } + }); + // 过滤数据 + const newList = list.value!.filter((item: any) => { + return item.rank <= 3 || item.rank == deadLine.value || item.rank === mineRank || item.rank === mineRank - 1 || item.rank === mineRank + 1; + }) return { - filterData, + newList, deadLine, } }