Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
f69b5bb0
Commit
f69b5bb0
authored
Oct 31, 2018
by
xinyuandu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hu商学院滚动效果
parent
15572039
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
articleList.vue
public/appnew/src/components/businessCollege/articleList.vue
+27
-1
No files found.
public/appnew/src/components/businessCollege/articleList.vue
View file @
f69b5bb0
...
...
@@ -2,7 +2,7 @@
<div>
<header-pulic
:data=
"headerData"
></header-pulic>
<nav>
<div
class=
"nav-main"
>
<div
class=
"nav-main"
v-if=
"show"
ref=
"ele"
>
<ul
class=
"oh"
>
<li
v-for=
"(item, index) in mainData"
:key=
"item.labelName"
:data-id=
"item.id"
class=
"pointer-click-item fl bsb flex"
:class=
"
{active:index === initTabNumMain}" @click="tabMain(index)">
<p><img-error
:datasrc=
"urlImg(item.label.icon)"
:imgtype=
"'div'"
></img-error></p>
...
...
@@ -35,6 +35,7 @@
name
:
''
,
props
:
{
data
:
{
type
:
Object
,
default
:
()
=>
({
message
:
'hello'
...
...
@@ -67,6 +68,8 @@
pageSize
:
10
,
initTabNumMain
:
0
,
isLoading
:
false
,
//是否正在加载
show
:
true
,
heightBefor
:
0
,
mainData
:
[{
'dataList'
:
[],
'page'
:
1
,
//页码
...
...
@@ -78,6 +81,7 @@
'id'
:
0
,
'label_name'
:
'全部'
}
}]
}
},
...
...
@@ -98,7 +102,29 @@
_this
.
loadMain
();
});
},
mounted
()
{
window
.
addEventListener
(
'scroll'
,
this
.
handleScroll
,
true
);
// 监听(绑定)滚轮 滚动事件
},
methods
:
{
handleScroll
(){
// 页面滚动距顶部距离
var
scrollTop
=
window
.
pageYOffset
||
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
;
var
scroll
=
scrollTop
-
this
.
heightBefor
;
this
.
heightBefor
=
scrollTop
;
if
(
scroll
<
0
){
if
(
scroll
<-
10
){
this
.
show
=
true
;
}
}
else
{
if
(
this
.
show
)
{
let
heightCss
=
window
.
getComputedStyle
(
this
.
$refs
.
ele
).
height
;
if
(
this
.
heightBefor
>
heightCss
.
split
(
'px'
)[
0
]){
this
.
show
=
false
;
}
}
}
},
urlImg
(
u
)
{
let
_this
=
this
;
return
_this
.
common
.
ServerHost
+
'/app/images/'
+
u
;
...
...
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