<template>
<a-select
v-model="value"
@popupScroll="handlePopupScroll"
>
<a-select-option v-for="(item, index) in options" :key="index" :value="item">
{{ item }}
</a-select-option>
</a-select>
</template>
<script>
export default {
name: 'ASelect',
data() {
return {
value: undefined,
options: ['aa', 'bb']
};
},
created() {
this.fetchData();
},
methods: {
handlePopupScroll(value, value1, value2) {
const { scrollHeight, scrollTop, clientHeight } = value.target;
if (scrollHeight - scrollTop === clientHeight) {
this.params.pageSize += 20;
this.fetchData(this.params);
}
},
// 请求数据
fetchData(searchParam) {
// 获取数据的接口
}
}
};
</script>
a-select 下拉加载更多
最新推荐文章于 2024-06-04 14:53:20 发布