<el-autocomplete
ref="autocomplete"
v-if="item.instanceType === 'input'"
v-scrollLoad="() => load(fixedForm[item.instanceCode])"
:key="index"
size="medium"
:placeholder="item.placeholder"
v-model="fixedForm[item.instanceCode]"
value-key="text"
clearable
:fetch-suggestions="
(query, cb) => {
querySearch(query, cb)
}
"
:maxlength="100"
:trigger-on-focus="false"
@select="originalSearch"
@clear="originalSearch"
@keyup.enter.native.prevent="originalSearch"
>
</el-autocomplete>
load(queryString) {
// 日程编码建议分页
if (!this.needPageFlag || this.total < this.suggestList.pageSize * this.suggestList.pageNum) {
return false
}
this.suggestList.pageNum++
selectVisitFormNames({
type: this.objectCode,
})
.then((res) => {
this.total = Number(res.data.total)
this.$refs.autocomplete?.[0].$data.suggestions.push(...res.data.records)
})
.finally(() => {
this.autoLoading = false
})
},
el-autocomplete 中下拉数据滚动分页
于 2023-05-22 15:51:32 首次发布