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
062f5647
Commit
062f5647
authored
Nov 19, 2020
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: style
parent
824e9b8b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
90 additions
and
71 deletions
+90
-71
base-menu.tsx
examples/base-menu.tsx
+1
-1
index.tsx
examples/index.tsx
+1
-1
page-container.tsx
examples/page-container.tsx
+56
-51
side-menu.tsx
examples/side-menu.tsx
+1
-1
index.less
src/PageContainer/index.less
+12
-3
index.tsx
src/PageContainer/index.tsx
+1
-0
Tabs.ts
src/PageContainer/interfaces/Tabs.ts
+16
-6
BaseMenu.tsx
src/SiderMenu/BaseMenu.tsx
+2
-8
No files found.
examples/base-menu.tsx
View file @
062f5647
...
@@ -15,7 +15,7 @@ const BaseMenuDemo = {
...
@@ -15,7 +15,7 @@ const BaseMenuDemo = {
themeChecked
:
true
,
themeChecked
:
true
,
modeChecked
:
true
,
modeChecked
:
true
,
})
})
const
{
state
:
menuState
}
=
useMenuState
({
const
[
menuState
]
=
useMenuState
({
collapsed
:
false
,
collapsed
:
false
,
openKeys
:
[
'/dashboard'
]
as
string
[],
openKeys
:
[
'/dashboard'
]
as
string
[],
selectedKeys
:
[
'/dashboard/monitor'
]
as
string
[],
selectedKeys
:
[
'/dashboard/monitor'
]
as
string
[],
...
...
examples/index.tsx
View file @
062f5647
...
@@ -11,7 +11,7 @@ const BasicLayout = defineComponent({
...
@@ -11,7 +11,7 @@ const BasicLayout = defineComponent({
name
:
'BasicLayout'
,
name
:
'BasicLayout'
,
inheritAttrs
:
false
,
inheritAttrs
:
false
,
setup
(
_
,
{
slots
,
attrs
})
{
setup
(
_
,
{
slots
,
attrs
})
{
const
{
state
:
menuState
}
=
useMenuState
({
const
[
menuState
]
=
useMenuState
({
collapsed
:
false
,
collapsed
:
false
,
openKeys
:
[],
openKeys
:
[],
selectedKeys
:
[
'/welcome'
],
selectedKeys
:
[
'/welcome'
],
...
...
examples/page-container.tsx
View file @
062f5647
import
{
createApp
,
defineComponent
,
reactive
}
from
'vue'
;
import
{
createApp
,
defineComponent
,
reactive
}
from
'vue'
;
import
'ant-design-vue/dist/antd.less'
;
import
'ant-design-vue/dist/antd.less'
;
import
{
Button
,
Descriptions
,
Space
,
Statistic
,
Ta
bs
}
from
'ant-design-vue'
;
import
{
Button
,
Descriptions
,
Space
,
Statistic
,
Ta
g
,
message
}
from
'ant-design-vue'
;
import
{
PageContainer
}
from
'../src/PageContainer'
;
import
{
PageContainer
}
from
'../src/PageContainer'
;
import
{
default
as
ProProvider
}
from
'../src/ProProvider'
;
import
{
default
as
ProProvider
}
from
'../src/ProProvider'
;
import
{
createRouteContext
}
from
'../src/RouteContext'
;
import
{
createRouteContext
}
from
'../src/RouteContext'
;
import
{
LikeOutlined
}
from
'@ant-design/icons-vue'
;
import
{
LikeOutlined
}
from
'@ant-design/icons-vue'
;
import
'./index.less'
;
const
{
Item
:
DescriptionsItem
}
=
Descriptions
;
const
App
=
defineComponent
({
const
App
=
defineComponent
({
name
:
'App'
,
name
:
'App'
,
...
@@ -37,56 +36,62 @@ const App = defineComponent({
...
@@ -37,56 +36,62 @@ const App = defineComponent({
});
});
return
()
=>
(
return
()
=>
(
<
div
>
<
div
class=
"demo-page-box"
style=
"padding: 20px; background: #ccc;"
>
<
ProProvider
prefixCls=
{
'ant-pro'
}
contentWidth=
{
'Fixed'
}
>
<
ProProvider
prefixCls=
{
'ant-pro'
}
contentWidth=
{
'Fixed'
}
>
<
RouteContextProvider
>
<
RouteContextProvider
>
<
PageContainer
<
div
style=
"background: #fff; height: 500px;"
>
title=
"Title"
<
PageContainer
subTitle=
"This is a subtitle"
title=
"Title"
breadcrumb=
{
{
routes
}
}
subTitle=
"This is a subtitle"
onBack=
{
()
=>
null
}
breadcrumb=
{
{
routes
}
}
extra=
{
[
onBack=
{
()
=>
message
.
info
(
'@back click'
)
}
<
Button
key=
"3"
>
操作
</
Button
>,
tags=
{
[
'Tag 1'
,
'Tag 2'
].
map
(
tag
=>
(<
Tag
color=
"blue"
>
{
tag
}
</
Tag
>))
}
<
Button
key=
"2"
>
操作
</
Button
>,
extra=
{
[
<
Button
key=
"1"
type=
"primary"
>
<
Button
key=
"3"
>
操作
</
Button
>,
主操作
<
Button
key=
"2"
>
操作
</
Button
>,
</
Button
>,
<
Button
key=
"1"
type=
"primary"
>
]
}
主操作
content=
{
</
Button
>,
<
Descriptions
size=
"small"
column=
{
2
}
>
]
}
<
Descriptions
.
Item
label=
"创建人"
>
张三
</
Descriptions
.
Item
>
content=
{
<
Descriptions
.
Item
label=
"联系方式"
>
<
Descriptions
size=
"small"
column=
{
{
md
:
2
}
}
>
<
a
>
421421
</
a
>
<
Descriptions
.
Item
label=
"创建人"
>
张三
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"联系方式"
>
<
Descriptions
.
Item
label=
"创建时间"
>
2017-01-10
</
Descriptions
.
Item
>
<
a
>
421421
</
a
>
<
Descriptions
.
Item
label=
"更新时间"
>
2017-10-10
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"备注"
>
中国浙江省杭州市西湖区古翠路
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"创建时间"
>
2017-01-10
</
Descriptions
.
Item
>
</
Descriptions
>
<
Descriptions
.
Item
label=
"更新时间"
>
2017-10-10
</
Descriptions
.
Item
>
}
<
Descriptions
.
Item
label=
"备注"
>
中国浙江省杭州市西湖区古翠路
</
Descriptions
.
Item
>
extraContent=
{
</
Descriptions
>
<
Space
size=
{
24
}
>
}
<
Statistic
title=
"Feedback"
value=
{
1128
}
prefix=
{
<
LikeOutlined
/>
}
/>
extraContent=
{
<
Statistic
title=
"Unmerged"
value=
{
93
}
suffix=
"/ 100"
/>
<
Space
size=
{
24
}
>
</
Space
>
<
Statistic
title=
"Feedback"
value=
{
1128
}
prefix=
{
<
LikeOutlined
/>
}
/>
}
<
Statistic
title=
"Unmerged"
value=
{
93
}
suffix=
"/ 100"
/>
tabList=
{
[
</
Space
>
{
key
:
'1'
,
tab
:
'Details'
},
}
{
key
:
'2'
,
tab
:
'Rule'
},
tabList=
{
[
]
}
{
key
:
'1'
,
tab
:
'Details'
},
tabActiveKey=
{
state
.
tabActiveKey
}
{
key
:
'2'
,
tab
:
'Rule'
},
onTabChange=
{
(
key
:
string
)
=>
{
]
}
console
.
log
(
'onTabChange'
,
key
);
tabProps=
{
{
state
.
tabActiveKey
=
key
;
type
:
'card'
,
}
}
}
}
footer=
{
[
tabActiveKey=
{
state
.
tabActiveKey
}
<
Button
key=
"3"
>
重置
</
Button
>,
onTabChange=
{
(
key
:
string
)
=>
{
<
Button
key=
"2"
type=
"primary"
>
console
.
log
(
'onTabChange'
,
key
);
提交
state
.
tabActiveKey
=
key
;
</
Button
>,
}
}
]
}
footer=
{
[
>
<
Button
key=
"3"
>
重置
</
Button
>,
<
div
>
Page Content
</
div
>
<
Button
key=
"2"
type=
"primary"
>
</
PageContainer
>
提交
</
Button
>,
]
}
>
<
div
>
Page Content
</
div
>
</
PageContainer
>
</
div
>
</
RouteContextProvider
>
</
RouteContextProvider
>
</
ProProvider
>
</
ProProvider
>
</
div
>
</
div
>
...
...
examples/side-menu.tsx
View file @
062f5647
...
@@ -10,7 +10,7 @@ import * as Icon from '@ant-design/icons-vue';
...
@@ -10,7 +10,7 @@ import * as Icon from '@ant-design/icons-vue';
const
DemoComponent
=
{
const
DemoComponent
=
{
setup
()
{
setup
()
{
const
{
state
:
menuState
}
=
useMenuState
({
const
[
menuState
]
=
useMenuState
({
collapsed
:
false
,
collapsed
:
false
,
openKeys
:
[
''
],
openKeys
:
[
''
],
selectedKeys
:
[
'/welcome'
],
selectedKeys
:
[
'/welcome'
],
...
...
src/PageContainer/index.less
View file @
062f5647
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
@pro-layout-page-container: ~'@{ant-prefix}-pro-page-container';
@pro-layout-page-container: ~'@{ant-prefix}-pro-page-container';
.@{pro-layout-page-container}-children-content {
.@{pro-layout-page-container}-children-content {
margin: 24px 24px 0;
margin: 24px 24px 0;
}
}
...
@@ -13,11 +14,19 @@
...
@@ -13,11 +14,19 @@
margin: 0;
margin: 0;
}
}
// fix antd@4 upgrade PageHeader style.
// fix antd@4 upgrade PageHeader style.
.ant-page-header-heading {
.@{ant-prefix}-page-header-heading {
.ant-page-header-heading-title,.ant-page-header-heading-extra {
.@{ant-prefix}-page-header-back {
margin: 12px 0;
margin-right: 16px;
}
.@{ant-prefix}-page-header-heading-title,
.@{ant-prefix}-page-header-heading-extra {
margin: 4px 0;
margin: 4px 0;
}
}
.ant-page-header-heading-sub-title {
.@{ant-prefix}-page-header-heading-sub-title {
margin: 9px 12px 9px 0;
}
.@{ant-prefix}-page-header-heading-tags {
margin: 9px 0;
margin: 9px 0;
}
}
}
}
...
...
src/PageContainer/index.tsx
View file @
062f5647
...
@@ -78,6 +78,7 @@ const renderFooter = (
...
@@ -78,6 +78,7 @@ const renderFooter = (
tabProps
,
tabProps
,
prefixedClassName
,
prefixedClassName
,
}
=
props
;
}
=
props
;
console
.
log
(
'tabProps'
,
tabProps
);
if
(
tabList
&&
tabList
.
length
)
{
if
(
tabList
&&
tabList
.
length
)
{
return
(
return
(
<
Tabs
<
Tabs
...
...
src/PageContainer/interfaces/Tabs.ts
View file @
062f5647
import
{
VNodeChild
,
CSSProperties
}
from
'vue'
;
import
{
VNodeChild
,
CSSProperties
}
from
'vue'
;
export
type
TabBarType
=
'line'
|
'card'
|
'editable-card'
;
export
type
TabSize
=
'default'
|
'large'
|
'small'
;
export
type
TabPosition
=
'left'
|
'right'
;
export
type
TabBarExtraPosition
=
TabPosition
;
export
type
TabBarExtraMap
=
Partial
<
Record
<
TabBarExtraPosition
,
VNodeChild
>>
;
export
type
TabBarExtraContent
=
VNodeChild
|
TabBarExtraMap
;
export
interface
TabsProps
{
export
interface
TabsProps
{
prefixCls
?:
string
;
prefixCls
?:
string
;
class
?:
string
|
string
[];
class
?:
string
|
string
[];
...
@@ -7,10 +16,11 @@ export interface TabsProps {
...
@@ -7,10 +16,11 @@ export interface TabsProps {
id
?:
string
;
id
?:
string
;
activeKey
?:
string
;
activeKey
?:
string
;
hideAdd
?:
boolean
;
// Unchangeable
// size?: TabSize;
tabBarStyle
?:
CSSProperties
;
tabPosition
?:
TabPosition
;
type
?:
TabBarType
;
tabBarGutter
?:
number
;
}
}
export
type
TabBarExtraPosition
=
'left'
|
'right'
;
export
type
TabBarExtraMap
=
Partial
<
Record
<
TabBarExtraPosition
,
VNodeChild
>>
;
export
type
TabBarExtraContent
=
VNodeChild
|
TabBarExtraMap
;
src/SiderMenu/BaseMenu.tsx
View file @
062f5647
...
@@ -42,10 +42,7 @@ interface MenuStated {
...
@@ -42,10 +42,7 @@ interface MenuStated {
openKeys
:
string
[];
openKeys
:
string
[];
}
}
export
interface
MenuStateWatched
{
export
type
MenuStateWatched
=
[
state
:
MenuStated
,
watchRef
:
WatchStopHandle
]
state
:
MenuStated
;
watchRef
:
WatchStopHandle
;
}
export
function
useMenuState
({
export
function
useMenuState
({
collapsed
=
false
,
collapsed
=
false
,
...
@@ -71,10 +68,7 @@ export function useMenuState({
...
@@ -71,10 +68,7 @@ export function useMenuState({
},
},
);
);
return
{
return
[
state
,
watchRef
]
state
,
watchRef
,
};
}
}
export
function
useRootSubmenuKeys
(
menus
:
RouteProps
[]):
ComputedRef
<
string
[]
>
{
export
function
useRootSubmenuKeys
(
menus
:
RouteProps
[]):
ComputedRef
<
string
[]
>
{
...
...
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