当前位置: 首页 > news >正文

element 远程搜索下拉加载

created() {
this.getList();
this.getGroupList();
},
directives: {
/** 下拉框懒加载 */
“el-select-loadmore”: {
bind(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();
}
});
},
},
},

// 远程搜索
remoteMethod(query) {
if (query !== “”) {
this.shopList = [];
this.loadingshop = true;
this.shopParams.name = query;
this.shopParams.page = 1;
this.getcommodityList();
}
},
//下拉加载
loadMore() {
if (this.lastPage) return;
this.shopParams.page++;
this.getcommodityList();
},
// 获取商品列表
getcommodityList() {
getGoodsList(this.shopParams).then((response) => {
this.lastPage = response.data.paginationResponse.lastPage;
var newShop = response.data.paginationResponse.content;
this.shopList = this.shopList.concat(newShop);
this.loadingshop = false;
});
},

http://www.lryc.cn/news/32035.html

相关文章:

  • 空间复杂度与顺序表的具体实现操作(1)
  • 【springmvc】Rest ful风格
  • 华为OD机试真题Python实现【用户调度】真题+解题思路+代码(20222023)
  • JavaSE学习笔记总结day19
  • FreeSql使用
  • Hadoop集群搭建,基于3.3.4hadoop和centos8【图文教程-从零开始搭建Hadoop集群】,常见问题解决
  • UE4 材质学习 (焚烧材质)
  • 【c++】STL常用算法2—常用查找算法
  • 史上最全最详细的Java架构师成长路径图,程序员必备
  • 第五章 事务管理
  • Redis:主从同步
  • Unity Animator.Play(stateName, layer, normalizedTime) 播放动画函数用法
  • python学习——【第三弹】
  • 科技云报道:AI大模型背后,竟是惊人的碳排放
  • 如何根据实际需求选择合适的三维实景建模方式?
  • CENTO OS上的网络安全工具(十八)ClickHouse及编程环境部署
  • Java中class文件的格式
  • C++排序算法
  • JAVA后端部署项目三步走
  • php使用zookeeper实现分布式锁
  • 力扣-可回收且低脂的产品
  • 代码随想录刷题-数组-二分查找
  • HCIA复习1
  • Kotlin中的destructuring解构声明
  • Kubernetes Pod 水平自动伸缩(HPA)
  • 钉钉、企业微信和飞书向“钱”看
  • 网上购物网站的设计
  • 【Java学习笔记】8.Java 运算符
  • RHCSA-使用命令管理文件(3.6)
  • socket聊天室--socket的建立