优化代码

master
叶志超 2021-12-22 15:02:15 +08:00
parent 93a12decbf
commit 728aa09585
1 changed files with 11 additions and 20 deletions

View File

@ -10,29 +10,20 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts" setup>
import { ref, defineComponent } from 'vue' import { ref } from 'vue'
import FlagView from './components/FlagView.vue' import FlagView from './components/FlagView.vue'
import EarthView from './components/EarthView.vue' import EarthView from './components/EarthView.vue'
import SatelliteTableView from './components/SatelliteTableView.vue' import SatelliteTableView from './components/SatelliteTableView.vue'
import SatelliteSystemSelectView from './components/SatelliteSystemSelectView.vue' import SatelliteSystemSelectView from './components/SatelliteSystemSelectView.vue'
export default defineComponent({ const earthView = ref(null)
setup () { const flagView = ref(null)
const earthView = ref(null) const onSatelliteSystemChanged = ss => {
const flagView = ref(null) if (earthView.value) earthView.value.loadSatelliteOrbit(ss)
const onSatelliteSystemChanged = ss => { if (flagView.value) flagView.value.show_flag(ss)
if (earthView.value) earthView.value.loadSatelliteOrbit(ss) }
if (flagView.value) flagView.value.show_flag(ss) const onTrackSatelliteSelected = id => {
} if (earthView.value) earthView.value.trackSatellite(id)
const onTrackSatelliteSelected = id => { }
if (earthView.value) earthView.value.trackSatellite(id)
}
return { earthView, flagView, onSatelliteSystemChanged, onTrackSatelliteSelected }
},
components: {
FlagView, EarthView, SatelliteSystemSelectView, SatelliteTableView
}
})
</script> </script>