fix(survey ) : 修复我的问卷搜索功能异常
- 修复点击搜索之后进入其他页面,然后返回会造成数据多次显示的问题
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onBeforeMount, ref } from 'vue';
|
import { onBeforeMount, onUnmounted, ref } from 'vue';
|
||||||
import NavSearch from '@/components/Search/Index.vue';
|
import NavSearch from '@/components/Search/Index.vue';
|
||||||
import NewSurvey from '@/views/Home/components/NewSurvey/index.vue';
|
import NewSurvey from '@/views/Home/components/NewSurvey/index.vue';
|
||||||
import EmptyContainer from '@/views/Survey/components/EmptyContainer.vue';
|
import EmptyContainer from '@/views/Survey/components/EmptyContainer.vue';
|
||||||
@@ -60,6 +60,11 @@ onBeforeMount(() => {
|
|||||||
handleLoadSurveys();
|
handleLoadSurveys();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
// 当组件卸载的时候,清空 survey 数据
|
||||||
|
survey.value = [];
|
||||||
|
});
|
||||||
|
|
||||||
function handleLoadSurveys() {
|
function handleLoadSurveys() {
|
||||||
form.value.page = form.value.page + 1;
|
form.value.page = form.value.page + 1;
|
||||||
fetchSurveys(form.value);
|
fetchSurveys(form.value);
|
||||||
|
|||||||
Reference in New Issue
Block a user