Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
najiu-frontend
najiu-admin-template
Commits
25d43a5f
Commit
25d43a5f
authored
Nov 24, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix topMenu align not work
parent
36734100
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
18 deletions
+20
-18
global.less
src/design/global.less
+2
-2
LayoutHeader.tsx
src/layouts/default/header/LayoutHeader.tsx
+16
-14
index.less
src/layouts/default/header/index.less
+2
-2
No files found.
src/design/global.less
View file @
25d43a5f
...
...
@@ -26,11 +26,11 @@
}
.justify-start {
justify-content: start;
justify-content:
flex-
start;
}
.justify-end {
justify-content: end;
justify-content:
flex-
end;
}
.justify-around {
...
...
src/layouts/default/header/LayoutHeader.tsx
View file @
25d43a5f
import
'
./index.less
'
;
import
{
defineComponent
,
unref
,
computed
,
ref
}
from
'
vue
'
;
import
{
defineComponent
,
unref
,
computed
,
ref
,
nextTick
}
from
'
vue
'
;
import
{
Layout
,
Tooltip
,
Badge
}
from
'
ant-design-vue
'
;
import
{
AppLogo
}
from
'
/@/components/Application
'
;
...
...
@@ -39,8 +39,8 @@ export default defineComponent({
setup
()
{
let
logoEl
:
Element
|
null
;
const
w
idthRef
=
ref
(
200
);
const
logoW
idthRef
=
ref
(
200
);
const
logoRef
=
ref
<
any
>
(
null
);
const
{
refreshPage
}
=
useTabs
();
const
{
getShowTopMenu
,
getShowHeaderTrigger
,
getSplit
,
getTopMenuAlign
}
=
useMenuSetting
();
...
...
@@ -64,15 +64,17 @@ export default defineComponent({
useWindowSizeFn
(
()
=>
{
if
(
!
unref
(
getShowTopMenu
))
return
;
let
width
=
0
;
if
(
!
logoEl
)
{
logoEl
=
document
.
querySelector
(
'
.layout-header__logo
'
);
}
if
(
logoEl
)
{
width
+=
logoEl
.
clientWidth
;
}
widthRef
.
value
=
width
+
60
;
nextTick
(()
=>
{
if
(
!
unref
(
getShowTopMenu
))
return
;
let
width
=
0
;
if
(
!
logoEl
)
{
logoEl
=
logoRef
.
value
.
$el
;
}
if
(
logoEl
)
{
width
+=
logoEl
.
clientWidth
;
}
logoWidthRef
.
value
=
width
+
80
;
});
},
200
,
{
immediate
:
true
}
...
...
@@ -105,11 +107,11 @@ export default defineComponent({
}
function
renderHeaderContent
()
{
const
width
=
unref
(
w
idthRef
);
const
width
=
unref
(
logoW
idthRef
);
return
(
<
div
class=
"layout-header__content "
>
{
unref
(
getShowHeaderLogo
)
&&
(
<
AppLogo
class=
{
`layout-header__logo`
}
theme=
{
unref
(
getTheme
)
}
/>
<
AppLogo
class=
{
`layout-header__logo`
}
ref=
{
logoRef
}
theme=
{
unref
(
getTheme
)
}
/>
)
}
{
unref
(
getShowContent
)
&&
(
...
...
src/layouts/default/header/index.less
View file @
25d43a5f
...
...
@@ -12,7 +12,7 @@
&__left {
display: flex;
flex-grow: 1;
//
flex-grow: 1;
align-items: center;
.layout-trigger {
...
...
@@ -184,7 +184,7 @@
}
&__menu {
margin-left:
20
px;
margin-left:
4
px;
overflow: hidden;
align-items: center;
}
...
...
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