網站首頁 編程語言 正文
1、聲明自定義指令:
directives: {
'loadmore': {
inserted(el, binding) {
const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap');
SELECTWRAP_DOM.addEventListener('scroll', function() {
const condition = this.scrollHeight - this.scrollTop <= this.clientHeight;
if (condition) {
binding.value();
}
});
}
}
},
2、使用自定義指令v-loadmore:
<el-select filterable v-model="form.standardDevice" placeholder="請選擇" clearable v-loadmore="loadMore" @change="handleChange">
<el-option v-for="item in deviceList" :key="item.deviceId" :label="item.deviceName" :value="item.serialNumber"></el-option>
<el-option v-if="selectLoading" v-loading="selectLoading" value=""></el-option>
</el-select>
3、發送請求加載數據
//滾動條滾動到底部
loadMore(){
//頁數加一
this.pageNum ++
//發送網絡請求
this.getDeviceList()
},
參考:el-select滾動到底部加載更多(分頁加載數據)_el-select 觸底加載分頁_天道酬勤_鹿的博客-CSDN博客
原文鏈接:https://blog.csdn.net/lq313131/article/details/131854820
- 上一篇:沒有了
- 下一篇:沒有了
相關推薦
- 2022-04-21 catalina.out 和 catalina.log 的區別和用途
- 2023-01-23 Python列表對象中元素的刪除操作方法_python
- 2022-02-18 解決scrapy爬蟲報錯 pymongo.errors.DuplicateKeyError: E11
- 2022-10-05 redis?哨兵集群搭建的實現_Redis
- 2022-12-26 層次分析法在matlab上的實現方式_python
- 2022-05-29 在Linux系統上安裝PostgreSQL數據庫_PostgreSQL
- 2022-03-29 Python順序結構語句詳解_python
- 2022-09-10 Oracle數據泵實現不同用戶導入導出表級_oracle
- 欄目分類
-
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支