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
da2c7be0
Commit
da2c7be0
authored
Aug 05, 2020
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: contentWidth prop type
parent
17536896
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
16 additions
and
10 deletions
+16
-10
BasicLayout.vue
examples/src/layouts/BasicLayout.vue
+1
-1
WrapContent.jsx
src/WrapContent.jsx
+1
-1
index.js
src/components/ConfigProvider/index.js
+1
-1
index.jsx
src/components/GlobalHeader/index.jsx
+1
-1
index.jsx
src/components/GridContent/index.jsx
+4
-2
LayoutChange.jsx
src/components/SettingDrawer/LayoutChange.jsx
+1
-1
index.jsx
src/components/SettingDrawer/index.jsx
+2
-2
SiderMenu.jsx
src/components/SiderMenu/SiderMenu.jsx
+1
-1
util.js
src/utils/util.js
+4
-0
No files found.
examples/src/layouts/BasicLayout.vue
View file @
da2c7be0
...
@@ -56,7 +56,7 @@ export default {
...
@@ -56,7 +56,7 @@ export default {
// 布局类型
// 布局类型
layout
:
'sidemenu'
,
// 'sidemenu', 'topmenu'
layout
:
'sidemenu'
,
// 'sidemenu', 'topmenu'
// 定宽: true / 流式: false
// 定宽: true / 流式: false
contentWidth
:
false
,
contentWidth
:
'Fluid'
,
// layout of content: `Fluid` or `Fixed`, only works when layout is topmenu
// 主题 'dark' | 'light'
// 主题 'dark' | 'light'
theme
:
'dark'
,
theme
:
'dark'
,
// 是否手机模式
// 是否手机模式
...
...
src/WrapContent.jsx
View file @
da2c7be0
...
@@ -11,7 +11,7 @@ const WrapContentProps = {
...
@@ -11,7 +11,7 @@ const WrapContentProps = {
isChildrenLayout
:
PropTypes
.
bool
,
isChildrenLayout
:
PropTypes
.
bool
,
location
:
PropTypes
.
any
,
location
:
PropTypes
.
any
,
contentHeight
:
PropTypes
.
number
,
contentHeight
:
PropTypes
.
number
,
contentWidth
:
PropTypes
.
bool
contentWidth
:
PropTypes
.
oneOf
([
'Fluid'
,
'Fixed'
]).
def
(
'Fluid'
),
}
}
const
WrapContent
=
{
const
WrapContent
=
{
...
...
src/components/ConfigProvider/index.js
View file @
da2c7be0
...
@@ -2,7 +2,7 @@ import PropTypes from 'ant-design-vue/es/_util/vue-types'
...
@@ -2,7 +2,7 @@ import PropTypes from 'ant-design-vue/es/_util/vue-types'
const
ProConfigProviderProps
=
{
const
ProConfigProviderProps
=
{
i18nRender
:
PropTypes
.
oneOfType
([
PropTypes
.
func
,
PropTypes
.
bool
]).
def
(
false
),
i18nRender
:
PropTypes
.
oneOfType
([
PropTypes
.
func
,
PropTypes
.
bool
]).
def
(
false
),
contentWidth
:
PropTypes
.
bool
,
contentWidth
:
PropTypes
.
oneOf
([
'Fluid'
,
'Fixed'
]).
def
(
'Fluid'
)
,
breadcrumbRender
:
PropTypes
.
func
,
breadcrumbRender
:
PropTypes
.
func
,
}
}
...
...
src/components/GlobalHeader/index.jsx
View file @
da2c7be0
...
@@ -60,7 +60,7 @@ const GlobalHeader = {
...
@@ -60,7 +60,7 @@ const GlobalHeader = {
)
}
)
}
{
renderCollapsedButton
()
}
{
renderCollapsedButton
()
}
{
headerContentRender
&&
(
{
headerContentRender
&&
(
<
div
class
Name
=
{
`${headerCls}-content`
}
>
<
div
class=
{
`${headerCls}-content`
}
>
{
isFun
(
headerContentRender
)
&&
headerContentRender
(
h
,
this
.
$props
)
||
headerContentRender
}
{
isFun
(
headerContentRender
)
&&
headerContentRender
(
h
,
this
.
$props
)
||
headerContentRender
}
</
div
>
</
div
>
)
}
)
}
...
...
src/components/GridContent/index.jsx
View file @
da2c7be0
import
'./index.less'
import
'./index.less'
import
PropTypes
from
'ant-design-vue/es/_util/vue-types'
import
PropTypes
from
'ant-design-vue/es/_util/vue-types'
import
{
layoutContentWidth
}
from
'../../utils/util'
const
GridContent
=
{
const
GridContent
=
{
name
:
'GridContent'
,
name
:
'GridContent'
,
functional
:
true
,
functional
:
true
,
props
:
{
props
:
{
children
:
PropTypes
.
any
,
children
:
PropTypes
.
any
,
contentWidth
:
PropTypes
.
bool
,
contentWidth
:
PropTypes
.
oneOf
([
'Fluid'
,
'Fixed'
]).
def
(
'Fluid'
)
,
},
},
render
(
h
,
content
)
{
render
(
h
,
content
)
{
const
{
contentWidth
:
propsContentWidth
}
=
content
.
props
const
{
contentWidth
}
=
content
.
props
const
children
=
content
.
children
const
children
=
content
.
children
const
propsContentWidth
=
layoutContentWidth
(
contentWidth
)
const
classNames
=
{
const
classNames
=
{
[
'ant-pro-grid-content'
]:
true
,
[
'ant-pro-grid-content'
]:
true
,
[
'wide'
]:
propsContentWidth
[
'wide'
]:
propsContentWidth
...
...
src/components/SettingDrawer/LayoutChange.jsx
View file @
da2c7be0
...
@@ -48,7 +48,7 @@ export default {
...
@@ -48,7 +48,7 @@ export default {
title
:
i18n
(
'app.setting.content-width'
),
title
:
i18n
(
'app.setting.content-width'
),
action
:
(
action
:
(
<
Select
<
Select
value=
{
contentWidth
&&
'Fixed'
||
'Fluid'
}
value=
{
contentWidth
}
size=
"small"
size=
"small"
onSelect=
{
(
value
)
=>
handleChange
(
'contentWidth'
,
value
)
}
onSelect=
{
(
value
)
=>
handleChange
(
'contentWidth'
,
value
)
}
style=
{
{
width
:
'80px'
}
}
style=
{
{
width
:
'80px'
}
}
...
...
src/components/SettingDrawer/index.jsx
View file @
da2c7be0
...
@@ -152,7 +152,7 @@ export const settings = {
...
@@ -152,7 +152,7 @@ export const settings = {
primaryColor
:
PropTypes
.
string
,
primaryColor
:
PropTypes
.
string
,
layout
:
PropTypes
.
oneOf
([
'sidemenu'
,
'topmenu'
]),
layout
:
PropTypes
.
oneOf
([
'sidemenu'
,
'topmenu'
]),
colorWeak
:
PropTypes
.
bool
,
colorWeak
:
PropTypes
.
bool
,
contentWidth
:
PropTypes
.
bool
,
contentWidth
:
PropTypes
.
oneOf
([
'Fluid'
,
'Fixed'
]).
def
(
'Fluid'
)
,
fixedHeader
:
PropTypes
.
bool
,
fixedHeader
:
PropTypes
.
bool
,
fixSiderbar
:
PropTypes
.
bool
,
fixSiderbar
:
PropTypes
.
bool
,
hideHintAlert
:
PropTypes
.
bool
.
def
(
false
),
hideHintAlert
:
PropTypes
.
bool
.
def
(
false
),
...
@@ -188,7 +188,7 @@ const SettingDrawer = {
...
@@ -188,7 +188,7 @@ const SettingDrawer = {
layout
=
'sidemenu'
,
layout
=
'sidemenu'
,
fixedHeader
=
false
,
fixedHeader
=
false
,
fixSiderbar
=
false
,
fixSiderbar
=
false
,
contentWidth
=
false
,
contentWidth
,
hideHintAlert
,
hideHintAlert
,
hideCopyButton
,
hideCopyButton
,
colorWeak
colorWeak
...
...
src/components/SiderMenu/SiderMenu.jsx
View file @
da2c7be0
...
@@ -12,7 +12,7 @@ export const SiderMenuProps = {
...
@@ -12,7 +12,7 @@ export const SiderMenuProps = {
i18nRender
:
PropTypes
.
oneOfType
([
PropTypes
.
func
,
PropTypes
.
bool
]).
def
(
false
),
i18nRender
:
PropTypes
.
oneOfType
([
PropTypes
.
func
,
PropTypes
.
bool
]).
def
(
false
),
mode
:
PropTypes
.
string
.
def
(
'inline'
),
mode
:
PropTypes
.
string
.
def
(
'inline'
),
theme
:
PropTypes
.
string
.
def
(
'dark'
),
theme
:
PropTypes
.
string
.
def
(
'dark'
),
contentWidth
:
PropTypes
.
bool
,
contentWidth
:
PropTypes
.
oneOf
([
'Fluid'
,
'Fixed'
]).
def
(
'Fluid'
)
,
collapsible
:
PropTypes
.
bool
,
collapsible
:
PropTypes
.
bool
,
collapsed
:
PropTypes
.
bool
,
collapsed
:
PropTypes
.
bool
,
handleCollapse
:
PropTypes
.
func
,
handleCollapse
:
PropTypes
.
func
,
...
...
src/utils/util.js
View file @
da2c7be0
...
@@ -10,6 +10,10 @@ const isFun = (func) => {
...
@@ -10,6 +10,10 @@ const isFun = (func) => {
return
typeof
func
===
'function'
return
typeof
func
===
'function'
}
}
export
const
layoutContentWidth
=
(
contentType
)
=>
{
return
contentType
!==
'Fluid'
}
const
themeConfig
=
{
const
themeConfig
=
{
daybreak
:
'daybreak'
,
daybreak
:
'daybreak'
,
'#1890ff'
:
'daybreak'
,
'#1890ff'
:
'daybreak'
,
...
...
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