Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dexfilter-web-nuxt3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
dexfilter-web-nuxt3
Commits
7cef0826
Commit
7cef0826
authored
Mar 24, 2023
by
lei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
c126913d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
19 deletions
+27
-19
.output.zip
+0
-0
views/layout/Search.vue
+27
-19
No files found.
.output.zip
View file @
7cef0826
No preview for this file type
views/layout/Search.vue
View file @
7cef0826
...
...
@@ -140,28 +140,30 @@ const isFirst = ref(true);
const
PopupMaxHeight
=
ref
<
number
>
(
800
);
// 搜索结果box高度
const
search_list_height
=
ref
<
number
>
(
0
);
const
darg
=
()
=>
{
// 滚动事件
const
SrcollEvent
=
()
=>
{
let
dom
:
any
=
document
.
getElementById
(
"search-token-list"
);
if
(
dom
!==
null
)
{
dom
.
addEventListener
(
"scroll"
,
()
=>
{
let
domHeight
=
dom
.
scrollHeight
;
let
domTop
=
dom
.
scrollTop
;
let
cliheight
=
dom
.
clientHeight
;
if
(
domHeight
-
cliheight
-
domTop
<=
20
&&
resultList
.
value
.
length
>=
19
)
{
// 滚动到底部
if
(
hasMorePages
.
value
)
{
// 如果当前加载更多已经执行,return
if
(
loadingMore
.
value
)
{
return
;
}
loadingMore
.
value
=
true
;
getTokenList
();
if
(
dom
)
{
let
domHeight
=
dom
.
scrollHeight
;
let
domTop
=
dom
.
scrollTop
;
let
cliheight
=
dom
.
clientHeight
;
if
(
domHeight
-
cliheight
-
domTop
<=
20
&&
resultList
.
value
.
length
>=
19
)
{
// 滚动到底部
if
(
hasMorePages
.
value
)
{
// 如果当前加载更多已经执行,return
if
(
loadingMore
.
value
)
{
return
;
}
loadingMore
.
value
=
true
;
getTokenList
();
}
});
}
}
};
const
darg
=
()
=>
{
let
dom
:
any
=
document
.
getElementById
(
"search-token-list"
);
if
(
dom
)
{
dom
.
addEventListener
(
"scroll"
,
SrcollEvent
);
}
};
const
getHeight
=
()
=>
{
...
...
@@ -194,6 +196,12 @@ onMounted(() => {
getHeight
();
});
});
onBeforeUnmount
(()
=>
{
let
dom
:
any
=
document
.
getElementById
(
"search-token-list"
);
if
(
dom
)
{
dom
.
removeEventListener
(
"scroll"
,
SrcollEvent
);
}
});
const
onChange
=
(
value
:
string
)
=>
{
keyword
.
value
=
value
;
getTokenList
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment