优化代码
parent
1aba962b06
commit
b8b8a09e3d
|
@ -46,16 +46,14 @@ import { ref, computed, watch } from 'vue'
|
||||||
|
|
||||||
const show = ref(false)
|
const show = ref(false)
|
||||||
|
|
||||||
|
// 表格数据更新时,滚动条回到最顶部
|
||||||
|
const satelliteTable = ref(null)
|
||||||
|
watch(satellites, () => satelliteTable.value.scrollTop = 0)
|
||||||
|
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
const satellites = computed(() => store.state.satellites.all)
|
const satellites = computed(() => store.state.satellites.all)
|
||||||
const onTrackButtonClicked = id => store.commit('satellites/track', id)
|
const onTrackButtonClicked = id => store.commit('satellites/track', id)
|
||||||
const onShowStateCheckboxChanged = id => store.commit('satellites/toggleShow', id)
|
const onShowStateCheckboxChanged = id => store.commit('satellites/toggleShow', id)
|
||||||
|
|
||||||
// 表格数据更新时,滚动条回到最顶部
|
|
||||||
const satelliteTable = ref(null)
|
|
||||||
watch(satellites, () => {
|
|
||||||
if (satelliteTable.value) satelliteTable.value.scrollTop = 0
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
Loading…
Reference in New Issue