Toggle navigation
Toggle navigation
This project
Loading...
Sign in
monitor_v3
/
hg-monitor-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
鲁尚清
3 years ago
Commit
33b5076a6a0d2aafd6c47f3f6ec5b42778b658fd
1 parent
708c16aa
【无】 web网站home首页导航高亮样式与当前路由对应
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
website/src/views/home/index.js
website/src/views/home/index.js
View file @
33b5076
...
...
@@ -32,23 +32,28 @@ export default {
let
logoData
=
Vue
.
ref
([
{
id
:
'1'
,
logoUrl
:
'logo-dong'
logoUrl
:
'logo-dong'
,
active
:
true
},
{
id
:
'2'
,
logoUrl
:
'logo-da'
logoUrl
:
'logo-da'
,
active
:
false
},
{
id
:
'3'
,
logoUrl
:
'logo-nan'
logoUrl
:
'logo-nan'
,
active
:
false
},
{
id
:
'4'
,
logoUrl
:
'logo-ren'
logoUrl
:
'logo-ren'
,
active
:
false
},
{
id
:
'5'
,
logoUrl
:
'logo-tong'
logoUrl
:
'logo-tong'
,
active
:
false
}
])
let
compatibleData
=
Vue
.
ref
([
...
...
@@ -91,13 +96,13 @@ export default {
items
:
1
,
margin
:
20
,
nav
:
false
,
dots
:
tru
e
,
dots
:
fals
e
,
active
:
true
,
dotsEach
:
2
,
smartSpeed
:
1000
,
autoplay
:
5000
,
// navText: ['<span class="flaticon-left-arrow"></span>', '<span class="flaticon-right-arrow"></span>'],
dotsText
:
[
'<span class="flaticon-left-arrow"></span>'
,
'<span class="flaticon-right-arrow"></span>'
],
// dotsData
: ['<span class="flaticon-left-arrow"></span>', '<span class="flaticon-right-arrow"></span>'],
responsive
:
{
/* 0: {
items: 1,
...
...
@@ -116,6 +121,15 @@ export default {
}*/
}
});
//lsq 导航高亮样式对应路由
let
hashUr
=
location
.
hash
;
let
href
=
$
(
'.navigation li a'
).
attr
(
'href'
);
$
(
'.navigation li'
).
unbind
(
'click.li'
).
on
(
'click.li'
,
function
(){
if
(
hashUr
==
href
){
$
(
'.navigation li'
).
removeClass
(
'current'
);
$
(
this
).
addClass
(
'current'
)
}
})
})
return
{
isHover
,
...
...
Please
register
or
login
to post a comment