Skip to content

Commit

Permalink
fix: 修复搜索后滚动加载问题(#1590
Browse files Browse the repository at this point in the history
  • Loading branch information
wangdan-fit2cloud committed Nov 13, 2024
1 parent 4e48291 commit 99b6ca8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion ui/src/components/infinite-scroll/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ui/src/views/application/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 99b6ca8

Please sign in to comment.