Parcourir la source

航班视图-航班基础信息-字段重复问题修改

zhongxiaoyu il y a 2 ans
Parent
commit
c30d943973
1 fichiers modifiés avec 5 ajouts et 2 suppressions
  1. 5 2
      src/views/realTime/components/FlightView/useFlightInfo.ts

+ 5 - 2
src/views/realTime/components/FlightView/useFlightInfo.ts

@@ -288,8 +288,11 @@ export function useFlightInfo(name: string, dataContent: CommonValue[]) {
     key: 'proxy',
     getter: info => (info.proxy === 1 ? '是' : '否'),
   }
-  onMounted(() => {
-    if (name.includes('International')) {
+  onBeforeMount(() => {
+    if (
+      name.includes('International') &&
+      !flightInfoItems.value[0].find(item => item.key === 'proxy')
+    ) {
       flightInfoItems.value[0].push(proxyItem)
     }
   })