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
f4b995c0
Commit
f4b995c0
authored
Nov 18, 2021
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: copyright prop string type error
parent
9dbbd49c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
15 deletions
+18
-15
README.md
README.md
+3
-0
package.json
package.json
+1
-1
BasicLayout.tsx
src/BasicLayout.tsx
+0
-1
index.tsx
src/FooterToolbar/index.tsx
+0
-9
index.tsx
src/GlobalFooter/index.tsx
+1
-1
getMenuData.ts
src/utils/getMenuData.ts
+13
-3
No files found.
README.md
View file @
f4b995c0
...
@@ -121,6 +121,9 @@ const layoutConf = reactive({
...
@@ -121,6 +121,9 @@ const layoutConf = reactive({
| menuSubItemRender | custom render Menu.SubItem | v-slot#menuSubItemRender="{ item, icon }"
\|
({ item, icon }) => VNode | null |
| menuSubItemRender | custom render Menu.SubItem | v-slot#menuSubItemRender="{ item, icon }"
\|
({ item, icon }) => VNode | null |
| locale | i18n | Function (key: string) => string
\|
`false`
|
`false`
|
| locale | i18n | Function (key: string) => string
\|
`false`
|
`false`
|
> Menu generation requires `getMenuData` and `clearMenuItem` function
> e.g. `const { menuData } = getMenuData(clearMenuItem(routes))`
### PageContainer
### PageContainer
| Property | Description | Type | Default Value |
| Property | Description | Type | Default Value |
...
...
package.json
View file @
f4b995c0
{
{
"name"
:
"@ant-design-vue/pro-layout"
,
"name"
:
"@ant-design-vue/pro-layout"
,
"version"
:
"3.1.
3
"
,
"version"
:
"3.1.
4
"
,
"license"
:
"
MIT
"
,
"license"
:
"
MIT
"
,
"files"
:
[
"files"
:
[
"dist"
"dist"
...
...
src/BasicLayout.tsx
View file @
f4b995c0
...
@@ -87,7 +87,6 @@ const ProLayout = defineComponent({
...
@@ -87,7 +87,6 @@ const ProLayout = defineComponent({
'menuClick'
,
'menuClick'
,
],
],
setup
(
props
,
{
emit
,
slots
})
{
setup
(
props
,
{
emit
,
slots
})
{
console
.
log
(
'props'
,
props
);
const
isTop
=
computed
(()
=>
props
.
layout
===
'top'
);
const
isTop
=
computed
(()
=>
props
.
layout
===
'top'
);
const
hasSide
=
computed
(()
=>
props
.
layout
===
'mix'
||
props
.
layout
===
'side'
||
false
);
const
hasSide
=
computed
(()
=>
props
.
layout
===
'mix'
||
props
.
layout
===
'side'
||
false
);
const
hasSplitMenu
=
computed
(()
=>
props
.
layout
===
'mix'
&&
props
.
splitMenus
);
const
hasSplitMenu
=
computed
(()
=>
props
.
layout
===
'mix'
&&
props
.
splitMenus
);
...
...
src/FooterToolbar/index.tsx
View file @
f4b995c0
...
@@ -42,18 +42,9 @@ const FooterToolbar = defineComponent({
...
@@ -42,18 +42,9 @@ const FooterToolbar = defineComponent({
if
(
!
siderWidth
||
layout
===
'top'
)
{
if
(
!
siderWidth
||
layout
===
'top'
)
{
return
'100%'
;
return
'100%'
;
}
}
console
.
log
(
'x'
,
unref
(
siderWidth
),
'hasFlatMenu'
,
unref
(
hasFlatMenu
),
'hasSide'
,
unref
(
context
.
hasSide
),
);
if
(
!
hasFlatMenu
.
value
&&
!
unref
(
hasSide
))
{
if
(
!
hasFlatMenu
.
value
&&
!
unref
(
hasSide
))
{
return
'100%'
;
return
'100%'
;
}
}
console
.
log
(
'x2'
,
unref
(
context
.
hasSide
));
return
isMobile
?
'100%'
:
`calc(100% -
${
siderWidth
}
px)`
;
return
isMobile
?
'100%'
:
`calc(100% -
${
siderWidth
}
px)`
;
});
});
...
...
src/GlobalFooter/index.tsx
View file @
f4b995c0
...
@@ -23,7 +23,7 @@ export default defineComponent({
...
@@ -23,7 +23,7 @@ export default defineComponent({
props
:
{
props
:
{
links
:
[
Array
,
Boolean
]
as
PropType
<
Links
>
,
links
:
[
Array
,
Boolean
]
as
PropType
<
Links
>
,
copyright
:
{
copyright
:
{
type
:
[
Object
,
Function
,
Boolean
]
as
PropType
<
VNodeChild
|
JSX
.
Element
>
,
type
:
[
String
,
Object
,
Function
,
Boolean
]
as
PropType
<
VNodeChild
|
JSX
.
Element
>
,
default
:
()
=>
undefined
,
default
:
()
=>
undefined
,
},
},
prefixCls
:
{
prefixCls
:
{
...
...
src/utils/getMenuData.ts
View file @
f4b995c0
import
type
{
RouteRecordRaw
}
from
'vue-router'
;
import
type
{
RouteRecordRaw
}
from
'vue-router'
;
export
{
clearMenuItem
,
flatMap
,
getMenuFirstChildren
}
from
'./index'
;
export
{
clearMenuItem
,
flatMap
,
getMenuFirstChildren
}
from
'./index'
;
export
type
MenuData
=
{
export
type
MenuData
=
{
...
@@ -6,7 +7,7 @@ export type MenuData = {
...
@@ -6,7 +7,7 @@ export type MenuData = {
breadcrumb
:
Record
<
string
,
any
>
;
breadcrumb
:
Record
<
string
,
any
>
;
};
};
const
formatRelativePath
=
(
export
const
formatRelativePath
=
(
routes
:
RouteRecordRaw
[],
routes
:
RouteRecordRaw
[],
breadcrumb
:
Record
<
string
,
any
>
,
breadcrumb
:
Record
<
string
,
any
>
,
parent
?:
RouteRecordRaw
,
parent
?:
RouteRecordRaw
,
...
@@ -28,8 +29,17 @@ const formatRelativePath = (
...
@@ -28,8 +29,17 @@ const formatRelativePath = (
});
});
};
};
export
const
getMenuData
=
(
routes
:
RouteRecordRaw
[]):
MenuData
=>
{
/**
const
childrenRoute
=
routes
.
find
(
route
=>
route
.
path
===
'/'
);
*
* @param routes all routes
* @param child find first route
* @returns { childrens, breadcrumb }
*/
export
const
getMenuData
=
(
routes
:
RouteRecordRaw
[],
child
?:
RouteRecordRaw
):
MenuData
=>
{
const
childrenRoute
=
routes
.
find
(
route
=>
(
child
&&
(
child
.
name
===
route
.
name
||
child
?.
path
===
route
.
path
))
||
route
.
path
===
'/'
,
);
const
breadcrumb
:
Record
<
string
,
any
>
=
{};
const
breadcrumb
:
Record
<
string
,
any
>
=
{};
return
{
return
{
menuData
:
formatRelativePath
(
childrenRoute
?.
children
||
([]
as
RouteRecordRaw
[]),
breadcrumb
),
menuData
:
formatRelativePath
(
childrenRoute
?.
children
||
([]
as
RouteRecordRaw
[]),
breadcrumb
),
...
...
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