From fce017221da4d3951af62541d37346f1ec8d61e9 Mon Sep 17 00:00:00 2001 From: monkeyhouyi Date: Thu, 31 Oct 2024 18:10:41 +0800 Subject: [PATCH] 懒加载 --- src/components/InfoForm/index.vue | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/components/InfoForm/index.vue b/src/components/InfoForm/index.vue index 3bb452a..49b06ef 100644 --- a/src/components/InfoForm/index.vue +++ b/src/components/InfoForm/index.vue @@ -34,9 +34,13 @@ clearable style="width: 100%" @change="companyChange" + v-selectLoadMore="initCompanyList" + :loading="name_loading" + :teleported="false" + :filter-method="filterMethod" > this.companyOptions.length) return + this.company_currentPage += 10; + }, + filterMethod(val) { + this.name_loading = true; + request({ + url: `/Extend/basecomapnyinfo/GetNoPagingList`, + method: "GET", + params: { + companyName: val, + } + }).then(({data}) => { + this.companyOptions = data; + this.name_loading = false; + + }) + }, handleAvatarSuccess(response, file, fileList) { if(response.code != 200) return; this.infoForm.systemIconModel = { @@ -458,11 +482,13 @@ export default { }, // 请求公司列表 async initCompanyList() { + this.name_loading = true; request({ url: `/Extend/basecomapnyinfo/GetNoPagingList`, method: "GET", }).then(({data}) => { this.companyOptions = data; + this.name_loading = false; }) }, async companyChange(val) { -- libgit2 0.21.4