Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pro-layout
Project
Project
Details
Activity
Releases
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
packages
pro-layout
Commits
f101c494
Unverified
Commit
f101c494
authored
Dec 03, 2019
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: menu trigger
parent
f64a3937
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
29 deletions
+36
-29
package.json
examples/package.json
+0
-1
index.jsx
examples/src/components/SelectLang/index.jsx
+1
-1
index.less
examples/src/components/SelectLang/index.less
+0
-4
BasicLayout.jsx
examples/src/layouts/BasicLayout.jsx
+11
-3
BasicLayout.less
examples/src/layouts/BasicLayout.less
+9
-1
BasicLayout.jsx
src/BasicLayout.jsx
+1
-18
Header.jsx
src/Header.jsx
+3
-1
Header.less
src/Header.less
+11
-0
No files found.
examples/package.json
View file @
f101c494
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
"@ant-design/icons"
:
"^4.0.0-alpha.11"
,
"@ant-design/icons"
:
"^4.0.0-alpha.11"
,
"ant-design-vue"
:
"^1.4.8"
,
"ant-design-vue"
:
"^1.4.8"
,
"core-js"
:
"^3.1.2"
,
"core-js"
:
"^3.1.2"
,
"vue"
:
"^2.6.10"
,
"vue-i18n"
:
"^8.15.0"
,
"vue-i18n"
:
"^8.15.0"
,
"vue-ls"
:
"^3.2.1"
,
"vue-ls"
:
"^3.2.1"
,
"vue-router"
:
"^3.0.6"
,
"vue-router"
:
"^3.0.6"
,
...
...
examples/src/components/SelectLang/index.jsx
View file @
f101c494
...
@@ -25,7 +25,7 @@ const SelectLang = {
...
@@ -25,7 +25,7 @@ const SelectLang = {
this
.
setLang
(
key
)
this
.
setLang
(
key
)
}
}
const
langMenu
=
(
const
langMenu
=
(
<
Menu
class=
{
'menu'
}
selectedKeys=
{
[
this
.
currentLang
]
}
onClick=
{
changeLang
}
>
<
Menu
class=
{
[
'menu'
,
'drop-down'
]
}
selectedKeys=
{
[
this
.
currentLang
]
}
onClick=
{
changeLang
}
>
{
locales
.
map
(
locale
=>
(
{
locales
.
map
(
locale
=>
(
<
Menu
.
Item
key=
{
locale
}
>
<
Menu
.
Item
key=
{
locale
}
>
<
span
role=
"img"
aria
-
label=
{
languageLabels
[
locale
]
}
>
<
span
role=
"img"
aria
-
label=
{
languageLabels
[
locale
]
}
>
...
...
examples/src/components/SelectLang/index.less
View file @
f101c494
...
@@ -15,10 +15,6 @@
...
@@ -15,10 +15,6 @@
}
}
}
}
.anticon {
margin-right: 8px;
}
&.select-lang {
&.select-lang {
.ant-dropdown-menu-item {
.ant-dropdown-menu-item {
min-width: 120px;
min-width: 120px;
...
...
examples/src/layouts/BasicLayout.jsx
View file @
f101c494
...
@@ -37,8 +37,12 @@ const Account = {
...
@@ -37,8 +37,12 @@ const Account = {
}
}
const
rightContentRender
=
(
h
,
props
)
=>
{
const
rightContentRender
=
(
h
,
props
)
=>
{
const
cls
=
{
'ant-pro-global-header-index-right'
:
true
,
[
`ant-pro-global-header-index-
${
props
.
theme
}
`
]:
true
}
return
(
return
(
<
div
class=
"ant-pro-global-header-index-right"
>
<
div
class=
{
cls
}
>
<
Account
class=
{
'ant-pro-global-header-index-action'
}
/>
<
Account
class=
{
'ant-pro-global-header-index-action'
}
/>
<
SelectLang
class=
{
'ant-pro-global-header-index-action'
}
/>
<
SelectLang
class=
{
'ant-pro-global-header-index-action'
}
/>
</
div
>
</
div
>
...
@@ -66,7 +70,9 @@ export default {
...
@@ -66,7 +70,9 @@ export default {
// 布局类型
// 布局类型
layout
:
'sidemenu'
,
// 'sidemenu', 'topmenu'
layout
:
'sidemenu'
,
// 'sidemenu', 'topmenu'
// 定宽: true / 流式: false
// 定宽: true / 流式: false
contentWidth
:
true
contentWidth
:
true
,
// 主题
theme
:
'dark'
}
}
},
},
render
(
h
)
{
render
(
h
)
{
...
@@ -74,7 +80,8 @@ export default {
...
@@ -74,7 +80,8 @@ export default {
collapsed
,
collapsed
,
contentWidth
,
contentWidth
,
autoHideHeader
,
autoHideHeader
,
layout
layout
,
theme
}
=
this
}
=
this
const
handleMediaQuery
=
(
val
)
=>
{
const
handleMediaQuery
=
(
val
)
=>
{
...
@@ -95,6 +102,7 @@ export default {
...
@@ -95,6 +102,7 @@ export default {
handleCollapse
,
handleCollapse
,
layout
,
layout
,
contentWidth
,
contentWidth
,
theme
,
rightContentRender
,
rightContentRender
,
footerRender
,
footerRender
,
i18nRender
,
i18nRender
,
...
...
examples/src/layouts/BasicLayout.less
View file @
f101c494
@import "~ant-design-vue/es/style/themes/default";
@import "~ant-design-vue/es/style/themes/default";
.ant-pro-global-header-index-right {
.ant-pro-global-header-index-right {
&.ant-pro-global-header-index-dark {
.ant-pro-global-header-index-action {
color: hsla(0,0%,100%,.85);
&:hover {
background: #1890ff;
}
}
}
.account {
.account {
.antd-pro-global-header-index-avatar {
.antd-pro-global-header-index-avatar {
margin: ~'calc((@{layout-header-height} - 24px) / 2)' 0;
margin: ~'calc((@{layout-header-height} - 24px) / 2)' 0;
margin-right: 8px;
margin-right: 8px;
...
@@ -21,3 +28,4 @@
...
@@ -21,3 +28,4 @@
}
}
}
}
}
}
src/BasicLayout.jsx
View file @
f101c494
...
@@ -83,6 +83,7 @@ const BasicLayout = {
...
@@ -83,6 +83,7 @@ const BasicLayout = {
layout
,
layout
,
logo
,
logo
,
contentWidth
,
contentWidth
,
theme
,
collapsed
,
collapsed
,
// eslint-disable-next-line
// eslint-disable-next-line
collapsedButtonRender
,
autoHideHeader
,
collapsedButtonRender
,
autoHideHeader
,
...
@@ -100,35 +101,17 @@ const BasicLayout = {
...
@@ -100,35 +101,17 @@ const BasicLayout = {
<
SiderMenuWrapper
<
SiderMenuWrapper
{
...
{
props
:
props
}
}
{
...
{
props
:
props
}
}
menus=
{
menus
}
menus=
{
menus
}
theme=
{
'dark'
}
mode=
{
'inline'
}
mode=
{
'inline'
}
logo=
{
logo
}
logo=
{
logo
}
isMobile=
{
false
}
collapsed=
{
collapsed
}
collapsed=
{
collapsed
}
onCollapse=
{
handleCollapse
}
onCollapse=
{
handleCollapse
}
handleCollapse=
{
handleCollapse
}
handleCollapse=
{
handleCollapse
}
title=
'Ant Design Pro'
/>
/>
)
}
)
}
<
Layout
class=
{
[
layout
]
}
style=
{
{
paddingLeft
:
'0'
,
minHeight
:
'100vh'
}
}
>
<
Layout
class=
{
[
layout
]
}
style=
{
{
paddingLeft
:
'0'
,
minHeight
:
'100vh'
}
}
>
{
/* <HeaderView
menus={menus}
contentWidth={contentWidth}
layout={layout}
theme={'dark'}
mode={'horizontal'}
logo={LogoSvg}
collapsed={collapsed}
handleCollapse={handleCollapse}
collapsedButtonRender={collapsedButtonRender}
autoHideHeader={autoHideHeader}
headerRender={headerRender}
title='Ant Design Pro' /> */
}
{
headerRender
(
h
,
{
{
headerRender
(
h
,
{
...
props
,
...
props
,
theme
:
'dark'
,
mode
:
'horizontal'
,
mode
:
'horizontal'
,
title
:
'Ant Design Pro'
})
}
})
}
<
Layout
.
Content
style=
{
{
margin
:
'24px 16px'
,
padding
:
'24px'
,
minHeight
:
'280px'
}
}
>
<
Layout
.
Content
style=
{
{
margin
:
'24px 16px'
,
padding
:
'24px'
,
minHeight
:
'280px'
}
}
>
<
GridContent
contentWidth=
{
contentWidth
}
>
<
GridContent
contentWidth=
{
contentWidth
}
>
...
...
src/Header.jsx
View file @
f101c494
...
@@ -51,7 +51,8 @@ const renderContent = (h, props) => {
...
@@ -51,7 +51,8 @@ const renderContent = (h, props) => {
const
maxWidth
=
1200
-
280
-
120
const
maxWidth
=
1200
-
280
-
120
const
contentWidth
=
props
.
contentWidth
const
contentWidth
=
props
.
contentWidth
const
baseCls
=
'ant-pro-top-nav-header'
const
baseCls
=
'ant-pro-top-nav-header'
const
{
logo
,
title
,
theme
,
headerRender
}
=
props
const
{
logo
,
title
,
theme
,
headerRender
,
rightContentRender
}
=
props
const
rightContentProps
=
{
theme
}
let
defaultDom
=
<
GlobalHeader
{
...
{
props
:
props
}}
/>
let
defaultDom
=
<
GlobalHeader
{
...
{
props
:
props
}}
/>
if
(
isTop
&&
!
isMobile
)
{
if
(
isTop
&&
!
isMobile
)
{
defaultDom
=
(
defaultDom
=
(
...
@@ -65,6 +66,7 @@ const renderContent = (h, props) => {
...
@@ -65,6 +66,7 @@ const renderContent = (h, props) => {
<
div
class=
{
`${baseCls}-menu`
}
style=
{
{
maxWidth
:
`${maxWidth}px`
,
flex
:
1
}
}
>
<
div
class=
{
`${baseCls}-menu`
}
style=
{
{
maxWidth
:
`${maxWidth}px`
,
flex
:
1
}
}
>
<
RouteMenu
{
...
{
props
:
props
}}
/>
<
RouteMenu
{
...
{
props
:
props
}}
/>
</
div
>
</
div
>
{
rightContentRender
(
h
,
rightContentProps
)
}
</
div
>
</
div
>
</
div
>
</
div
>
)
)
...
...
src/Header.less
View file @
f101c494
...
@@ -157,3 +157,14 @@
...
@@ -157,3 +157,14 @@
}
}
}
}
}
}
.drop-down {
&.menu {
.anticon {
margin-right: 8px;
}
.ant-dropdown-menu-item {
min-width: 160px;
}
}
}
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