mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
下拉框支持分页加载
This commit is contained in:
@@ -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()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user