Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
imac-vue
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Elements-SY
2023-09-15 17:38:04 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
dbd459d7a387cd4f5bab016d3fb2d1c511842c85
dbd459d7
2 parents
44e45865
8bffd73e
Merge branch 'fix-issues' into uat
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
src/utils/index.js
src/utils/mixins.js
src/utils/index.js
View file @
dbd459d
...
...
@@ -223,7 +223,7 @@ export function getTime(type) {
* @return {*}
*/
export
function
debounce
(
func
,
wait
,
immediate
)
{
let
timeout
,
args
,
context
,
timestamp
,
result
;
let
timeout
,
args
,
context
,
timestamp
,
result
,
data
;
const
later
=
function
()
{
// 据上一次触发时间间隔
...
...
@@ -236,7 +236,7 @@ export function debounce(func, wait, immediate) {
timeout
=
null
;
// 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
if
(
!
immediate
)
{
result
=
func
.
apply
(
context
,
args
);
result
=
func
.
apply
(
context
,
data
);
if
(
!
timeout
)
context
=
args
=
null
;
}
}
...
...
@@ -245,6 +245,7 @@ export function debounce(func, wait, immediate) {
return
function
(...
args
)
{
context
=
this
;
timestamp
=
+
new
Date
();
data
=
args
;
const
callNow
=
immediate
&&
!
timeout
;
// 如果延时不存在,重新设定延时
if
(
!
timeout
)
timeout
=
setTimeout
(
later
,
wait
);
...
...
src/utils/mixins.js
deleted
100644 → 0
View file @
44e4586
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment