fix: 修复搜索后滚动加载问题(#1590)

This commit is contained in:
wangdan-fit2cloud 2024-11-13 13:17:48 +08:00 committed by wangdan-fit2cloud
parent 889900fbab
commit fd0f3e2b5a
2 changed files with 12 additions and 3 deletions

View File

@ -12,7 +12,7 @@
</div>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { ref, computed, watch } from 'vue'
defineOptions({ name: 'InfiniteScroll' })
const props = defineProps({
@ -47,6 +47,15 @@ const props = defineProps({
const emit = defineEmits(['update:current_page', 'load'])
const current = ref(props.current_page)
watch(
() => props.current_page,
(val) => {
if (val === 1) {
current.value = 1
}
}
)
const noMore = computed(
() =>
props.size > 0 && props.size === props.total && props.total > props.page_size && !props.loading

View File

@ -223,9 +223,9 @@ function searchHandle() {
if (user.userInfo) {
localStorage.setItem(user.userInfo.id + 'application', selectUserId.value)
}
paginationConfig.total = 0
paginationConfig.current_page = 1
applicationList.value = []
paginationConfig.current_page = 1
paginationConfig.total = 0
getList()
}
function getAccessToken(id: string) {