Skip to content

Commit fd0f3e2

Browse files
fix: 修复搜索后滚动加载问题(#1590
1 parent 889900f commit fd0f3e2

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

ui/src/components/infinite-scroll/index.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</div>
1313
</template>
1414
<script setup lang="ts">
15-
import { ref, computed } from 'vue'
15+
import { ref, computed, watch } from 'vue'
1616
1717
defineOptions({ name: 'InfiniteScroll' })
1818
const props = defineProps({
@@ -47,6 +47,15 @@ const props = defineProps({
4747
const emit = defineEmits(['update:current_page', 'load'])
4848
const current = ref(props.current_page)
4949
50+
watch(
51+
() => props.current_page,
52+
(val) => {
53+
if (val === 1) {
54+
current.value = 1
55+
}
56+
}
57+
)
58+
5059
const noMore = computed(
5160
() =>
5261
props.size > 0 && props.size === props.total && props.total > props.page_size && !props.loading

ui/src/views/application/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ function searchHandle() {
223223
if (user.userInfo) {
224224
localStorage.setItem(user.userInfo.id + 'application', selectUserId.value)
225225
}
226-
paginationConfig.total = 0
227-
paginationConfig.current_page = 1
228226
applicationList.value = []
227+
paginationConfig.current_page = 1
228+
paginationConfig.total = 0
229229
getList()
230230
}
231231
function getAccessToken(id: string) {

0 commit comments

Comments
 (0)