Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-presale
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 658f7f96
authored
Sep 12, 2025
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
下拉触发方法修改
1 parent
7b1da277
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
15 deletions
src/views/addCards/index.vue
src/views/worryFree/index.vue
src/views/addCards/index.vue
View file @
658f7f9
...
@@ -226,17 +226,24 @@ export default {
...
@@ -226,17 +226,24 @@ export default {
directives
:
{
directives
:
{
"el-select-loadmore"
:
{
"el-select-loadmore"
:
{
bind
(
el
,
binding
)
{
bind
(
el
,
binding
)
{
let
isTriggered
=
false
const
debounceTime
=
300
// 防抖时间
const
waitForDropdown
=
()
=>
{
const
waitForDropdown
=
()
=>
{
const
SELECTWRAP_DOM
=
el
.
querySelector
(
'.el-select-dropdown .el-select-dropdown__wrap'
)
const
SELECTWRAP_DOM
=
el
.
querySelector
(
'.el-select-dropdown .el-select-dropdown__wrap'
)
;
if
(
SELECTWRAP_DOM
)
{
if
(
SELECTWRAP_DOM
)
{
SELECTWRAP_DOM
.
addEventListener
(
'scroll'
,
function
()
{
SELECTWRAP_DOM
.
addEventListener
(
'scroll'
,
function
()
{
const
condition
=
this
.
scrollHeight
-
this
.
scrollTop
<=
this
.
clientHeight
+
1
const
condition
=
this
.
scrollHeight
-
this
.
scrollTop
<=
this
.
clientHeight
+
1
if
(
condition
)
{
if
(
condition
&&
!
isTriggered
)
{
isTriggered
=
true
binding
.
value
()
binding
.
value
()
// 延迟重置触发状态
setTimeout
(()
=>
{
isTriggered
=
false
},
debounceTime
)
}
}
})
;
})
}
else
{
}
else
{
// 如果没有找到下拉框DOM,延迟重试
(针对对话框情况)
// 如果没有找到下拉框DOM,延迟重试
setTimeout
(
waitForDropdown
,
50
)
setTimeout
(
waitForDropdown
,
50
)
}
}
}
}
...
@@ -261,6 +268,7 @@ export default {
...
@@ -261,6 +268,7 @@ export default {
})
})
},
},
interestsLoadmore
()
{
interestsLoadmore
()
{
console
.
log
(
'22222222'
)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
pageNum
=
this
.
pageNum
+
1
this
.
pageNum
=
this
.
pageNum
+
1
if
(
this
.
allPages
<
this
.
pageNum
)
{
if
(
this
.
allPages
<
this
.
pageNum
)
{
...
...
src/views/worryFree/index.vue
View file @
658f7f9
...
@@ -495,18 +495,23 @@ export default {
...
@@ -495,18 +495,23 @@ export default {
directives
:
{
directives
:
{
"el-select-loadmore"
:
{
"el-select-loadmore"
:
{
bind
(
el
,
binding
)
{
bind
(
el
,
binding
)
{
let
triggered
=
false
const
threshold
=
50
const
debounceTime
=
300
// 防抖时间
const
waitForDropdown
=
()
=>
{
const
waitForDropdown
=
()
=>
{
const
SELECTWRAP_DOM
=
el
.
querySelector
(
'.el-select-dropdown .el-select-dropdown__wrap'
)
const
SELECTWRAP_DOM
=
el
.
querySelector
(
'.el-select-dropdown .el-select-dropdown__wrap'
)
if
(
SELECTWRAP_DOM
)
{
if
(
SELECTWRAP_DOM
)
{
SELECTWRAP_DOM
.
addEventListener
(
'scroll'
,
function
()
{
SELECTWRAP_DOM
.
addEventListener
(
'scroll'
,
function
()
{
const
condition
=
this
.
scrollHeight
-
this
.
scrollTop
<=
this
.
clientHeight
+
1
const
scrollBottom
=
this
.
scrollHeight
-
this
.
scrollTop
-
this
.
clientHeight
if
(
condition
)
{
if
(
scrollBottom
<=
threshold
&&
!
triggered
)
{
binding
.
value
()
triggered
=
true
binding
.
value
()
// 执行加载更多
// 无论是否是异步操作,都延迟重置
setTimeout
(()
=>
{
triggered
=
false
},
debounceTime
)
}
}
});
})
}
else
{
// 如果没有找到下拉框DOM,延迟重试(针对对话框情况)
setTimeout
(
waitForDropdown
,
50
)
}
}
}
}
waitForDropdown
()
waitForDropdown
()
...
@@ -514,17 +519,24 @@ export default {
...
@@ -514,17 +519,24 @@ export default {
},
},
"el-select-loadmore-dialog"
:
{
"el-select-loadmore-dialog"
:
{
bind
(
el
,
binding
)
{
bind
(
el
,
binding
)
{
let
isTriggered
=
false
const
debounceTime
=
300
// 防抖时间
const
waitForDropdown
=
()
=>
{
const
waitForDropdown
=
()
=>
{
const
SELECTWRAP_DOM
=
el
.
querySelector
(
'.el-select-dropdown .el-select-dropdown__wrap'
)
const
SELECTWRAP_DOM
=
el
.
querySelector
(
'.el-select-dropdown .el-select-dropdown__wrap'
)
;
if
(
SELECTWRAP_DOM
)
{
if
(
SELECTWRAP_DOM
)
{
SELECTWRAP_DOM
.
addEventListener
(
'scroll'
,
function
()
{
SELECTWRAP_DOM
.
addEventListener
(
'scroll'
,
function
()
{
const
condition
=
this
.
scrollHeight
-
this
.
scrollTop
<=
this
.
clientHeight
+
1
const
condition
=
this
.
scrollHeight
-
this
.
scrollTop
<=
this
.
clientHeight
+
1
if
(
condition
)
{
if
(
condition
&&
!
isTriggered
)
{
isTriggered
=
true
binding
.
value
()
binding
.
value
()
// 延迟重置触发状态
setTimeout
(()
=>
{
isTriggered
=
false
},
debounceTime
)
}
}
})
;
})
}
else
{
}
else
{
// 如果没有找到下拉框DOM,延迟重试
(针对对话框情况)
// 如果没有找到下拉框DOM,延迟重试
setTimeout
(
waitForDropdown
,
50
)
setTimeout
(
waitForDropdown
,
50
)
}
}
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment