瀏覽代碼

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

zhongxiaoyu 2 年之前
父節點
當前提交
c30d943973
共有 1 個文件被更改,包括 5 次插入2 次删除
  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)
     }
   })