Преглед изворни кода

每场比赛只保留最多5个策略

flyzto пре 2 месеци
родитељ
комит
70b90175bd
1 измењених фајлова са 7 додато и 3 уклоњено
  1. 7 3
      web/apps/web-antd/src/views/match/components/solution_item.vue

+ 7 - 3
web/apps/web-antd/src/views/match/components/solution_item.vue

@@ -172,16 +172,20 @@ const switchSolution = (index) => {
   }
 };
 
+const topSolutions = computed(() => {
+  return props.solutions.slice(0, 5);
+});
+
 const currentIndex = computed(() => {
   const index = selectedIndex.value;
-  if (props.solutions[index]) {
+  if (topSolutions.value[index]) {
     return index;
   }
   return 0;
 });
 
 const currentSolution = computed(() => {
-  return props.solutions[currentIndex.value];
+  return topSolutions.value[currentIndex.value];
 });
 
 const currentRelation = computed(() => {
@@ -232,7 +236,7 @@ const hg = computed(() => {
     <div class="league-name">{{ currentRelation.leagueName }}</div>
     <div class="date-time">{{ currentRelation.dateTime }}</div>
     <div class="switch-btns">
-      <a href="javascript:;" v-for="(solution, index) in solutions" :key="index" :class="{ 'selected': index === currentIndex }" @click="switchSolution(index)">{{ solution.sol.win_average_rate ?? fixFloat(solution.sol.win_average / solution.sol.inner_base * 100) }}</a>
+      <a href="javascript:;" v-for="(solution, index) in topSolutions" :key="index" :class="{ 'selected': index === currentIndex }" @click="switchSolution(index)">{{ solution.sol.win_average_rate ?? fixFloat(solution.sol.win_average / solution.sol.inner_base * 100) }}</a>
     </div>
   </div>
   <div class="solution-content">