优化代码

master
叶志超 2021-12-23 10:21:31 +08:00
parent 1aba962b06
commit b8b8a09e3d
1 changed files with 4 additions and 6 deletions

View File

@ -45,17 +45,15 @@ import { ref, computed, watch } from 'vue'
const show = ref(false)
//
const satelliteTable = ref(null)
watch(satellites, () => satelliteTable.value.scrollTop = 0)
const store = useStore()
const satellites = computed(() => store.state.satellites.all)
const onTrackButtonClicked = id => store.commit('satellites/track', id)
const onShowStateCheckboxChanged = id => store.commit('satellites/toggleShow', id)
//
const satelliteTable = ref(null)
watch(satellites, () => {
if (satelliteTable.value) satelliteTable.value.scrollTop = 0
})
</script>
<style scoped>