Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
finance-oa
finance-manage
Commits
cc50224d
Commit
cc50224d
authored
Apr 14, 2021
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
固定顶部导航栏&窗口大小改变实时更新栏数
parent
ff09e1cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
ruoyi-ui/src/components/TopNav/index.vue
ruoyi-ui/src/components/TopNav/index.vue
+8
-9
ruoyi-ui/src/layout/components/Navbar.vue
ruoyi-ui/src/layout/components/Navbar.vue
+6
-1
No files found.
ruoyi-ui/src/components/TopNav/index.vue
View file @
cc50224d
...
@@ -95,21 +95,20 @@ export default {
...
@@ -95,21 +95,20 @@ export default {
return
activePath
;
return
activePath
;
},
},
},
},
beforeMount
()
{
window
.
addEventListener
(
'
resize
'
,
this
.
setVisibleNumber
)
},
beforeDestroy
()
{
window
.
removeEventListener
(
'
resize
'
,
this
.
setVisibleNumber
)
},
mounted
()
{
mounted
()
{
this
.
setVisibleNumber
();
this
.
setVisibleNumber
();
},
},
methods
:
{
methods
:
{
// 根据宽度计算设置显示栏数
// 根据宽度计算设置显示栏数
setVisibleNumber
()
{
setVisibleNumber
()
{
const
width
=
document
.
body
.
getBoundingClientRect
().
width
-
380
;
const
width
=
document
.
body
.
getBoundingClientRect
().
width
/
3
;
const
elWidth
=
this
.
$el
.
getBoundingClientRect
().
width
;
this
.
visibleNumber
=
parseInt
(
width
/
85
);
const
menuItemNodes
=
this
.
$el
.
children
;
const
menuWidth
=
Array
.
from
(
menuItemNodes
).
map
(
(
i
)
=>
i
.
getBoundingClientRect
().
width
);
this
.
visibleNumber
=
(
parseInt
(
width
-
elWidth
)
/
parseInt
(
menuWidth
)
).
toFixed
(
0
);
},
},
// 菜单选择事件
// 菜单选择事件
handleSelect
(
key
,
keyPath
)
{
handleSelect
(
key
,
keyPath
)
{
...
...
ruoyi-ui/src/layout/components/Navbar.vue
View file @
cc50224d
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<hamburger
id=
"hamburger-container"
:is-active=
"sidebar.opened"
class=
"hamburger-container"
@
toggleClick=
"toggleSideBar"
/>
<hamburger
id=
"hamburger-container"
:is-active=
"sidebar.opened"
class=
"hamburger-container"
@
toggleClick=
"toggleSideBar"
/>
<breadcrumb
id=
"breadcrumb-container"
class=
"breadcrumb-container"
v-if=
"!topNav"
/>
<breadcrumb
id=
"breadcrumb-container"
class=
"breadcrumb-container"
v-if=
"!topNav"
/>
<top-nav
id=
"topmenu-container"
class=
"
breadcrumb
-container"
v-if=
"topNav"
/>
<top-nav
id=
"topmenu-container"
class=
"
topmenu
-container"
v-if=
"topNav"
/>
<div
class=
"right-menu"
>
<div
class=
"right-menu"
>
<template
v-if=
"device!=='mobile'"
>
<template
v-if=
"device!=='mobile'"
>
...
@@ -135,6 +135,11 @@ export default {
...
@@ -135,6 +135,11 @@ export default {
float
:
left
;
float
:
left
;
}
}
.topmenu-container
{
position
:
absolute
;
left
:
50px
;
}
.errLog-container
{
.errLog-container
{
display
:
inline-block
;
display
:
inline-block
;
vertical-align
:
top
;
vertical-align
:
top
;
...
...
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