优化代码
parent
1aba962b06
commit
b8b8a09e3d
|
@ -46,16 +46,14 @@ 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>
|
||||
|
|
Loading…
Reference in New Issue