diff --git a/src/hooks/rainstorm/useRainDisasterChain.ts b/src/hooks/rainstorm/useRainDisasterChain.ts index dfc961d..49ebac0 100644 --- a/src/hooks/rainstorm/useRainDisasterChain.ts +++ b/src/hooks/rainstorm/useRainDisasterChain.ts @@ -1,4 +1,4 @@ -import { ref } from 'vue'; +import { ref, watch } from 'vue'; import type { XianHiddenDangerSpots } from '@/types/base/XianHiddenDangerSpots'; import type { PaginationType } from '@/types/common/PaginationType'; import { PointType } from '@/types/common/DisasterType'; @@ -305,6 +305,15 @@ export const useRainDisasterChain = () => { ]; }; + // 监听条件变化 + watch( + conditions, + () => { + console.log('条件改变'); + }, + { deep: true } + ); + return { conditions, selectOptions, diff --git a/src/views/home/rainstorm/RainstormView.vue b/src/views/home/rainstorm/RainstormView.vue index 71807d9..c24d05c 100644 --- a/src/views/home/rainstorm/RainstormView.vue +++ b/src/views/home/rainstorm/RainstormView.vue @@ -71,13 +71,11 @@ import { useRainDisasterChain } from '@/hooks/rainstorm/useRainDisasterChain'; import { useStatusStore } from '@/stores/useStatusStore'; import { DisasterType } from '@/types/common/DisasterType.ts'; - import { watch } from 'vue'; import { useRoute } from 'vue-router'; const route = useRoute(); const { - conditions, selectOptions, tableDatas, tableColumns, @@ -89,15 +87,6 @@ changeConditions, changeCurrentPage, } = useRainDisasterChain(); - - // 监听条件变化 - watch( - conditions, - () => { - console.log('条件改变'); - }, - { deep: true } - );