From 52058d5ebc2ceb8bcb679160053a256303b291ae Mon Sep 17 00:00:00 2001 From: ghusermoon <2673031505@qq.com> Date: Thu, 19 Nov 2020 15:26:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=9C=89=E7=9B=B4=E6=92=AD?= =?UTF-8?q?=E8=B5=84=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mine/RankList.vue | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) 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, } }