fix: 修复搜索后滚动加载问题(#1590)
This commit is contained in:
parent
889900fbab
commit
fd0f3e2b5a
@ -12,7 +12,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
|
|
||||||
defineOptions({ name: 'InfiniteScroll' })
|
defineOptions({ name: 'InfiniteScroll' })
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -47,6 +47,15 @@ const props = defineProps({
|
|||||||
const emit = defineEmits(['update:current_page', 'load'])
|
const emit = defineEmits(['update:current_page', 'load'])
|
||||||
const current = ref(props.current_page)
|
const current = ref(props.current_page)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.current_page,
|
||||||
|
(val) => {
|
||||||
|
if (val === 1) {
|
||||||
|
current.value = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
const noMore = computed(
|
const noMore = computed(
|
||||||
() =>
|
() =>
|
||||||
props.size > 0 && props.size === props.total && props.total > props.page_size && !props.loading
|
props.size > 0 && props.size === props.total && props.total > props.page_size && !props.loading
|
||||||
|
|||||||
@ -223,9 +223,9 @@ function searchHandle() {
|
|||||||
if (user.userInfo) {
|
if (user.userInfo) {
|
||||||
localStorage.setItem(user.userInfo.id + 'application', selectUserId.value)
|
localStorage.setItem(user.userInfo.id + 'application', selectUserId.value)
|
||||||
}
|
}
|
||||||
paginationConfig.total = 0
|
|
||||||
paginationConfig.current_page = 1
|
|
||||||
applicationList.value = []
|
applicationList.value = []
|
||||||
|
paginationConfig.current_page = 1
|
||||||
|
paginationConfig.total = 0
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
function getAccessToken(id: string) {
|
function getAccessToken(id: string) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user