下拉框支持分页加载

This commit is contained in:
2023-04-15 11:55:41 +08:00
parent 6e27b782d0
commit 9ba9bf2297
2 changed files with 52 additions and 3 deletions

View File

@@ -84,3 +84,15 @@ new Vue({
store,
render: h => h(App)
})
Vue.directive('selectLoadMore', {
bind (el, binding) {
// 获取element-ui定义好的scroll盒子
const selectDom = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
selectDom .addEventListener('scroll', function () {
if (this.scrollHeight - this.scrollTop < this.clientHeight + 1) {
binding.value()
}
})
}
})