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
3f18261b
Commit
3f18261b
authored
Aug 31, 2021
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: FooterToolbar
parent
e76e047c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
26 deletions
+33
-26
BasicLayout.vue
examples/layouts/BasicLayout.vue
+3
-0
package.json
package.json
+1
-1
index.tsx
src/FooterToolbar/index.tsx
+29
-25
No files found.
examples/layouts/BasicLayout.vue
View file @
3f18261b
...
@@ -88,6 +88,9 @@
...
@@ -88,6 +88,9 @@
<router-view
/>
<router-view
/>
<!-- content end -->
<!-- content end -->
<FooterToolbar>
<FooterToolbar>
<
template
#
extra
>
<span>
FooterToolbar
</span>
</
template
>
<a-space>
<a-space>
<span
:disabled=
"state.layout !== 'mix'"
>
<span
:disabled=
"state.layout !== 'mix'"
>
<span
style=
"margin-right: 8px"
>
SplitMenus:
</span>
<span
style=
"margin-right: 8px"
>
SplitMenus:
</span>
...
...
package.json
View file @
3f18261b
{
{
"name"
:
"@ant-design-vue/pro-layout"
,
"name"
:
"@ant-design-vue/pro-layout"
,
"version"
:
"3.1.0-beta.
3
"
,
"version"
:
"3.1.0-beta.
4
"
,
"license"
:
"
MIT
"
,
"license"
:
"
MIT
"
,
"files"
:
[
"files"
:
[
"dist"
,
"dist"
,
...
...
src/FooterToolbar/index.tsx
View file @
3f18261b
...
@@ -2,7 +2,7 @@ import './index.less';
...
@@ -2,7 +2,7 @@ import './index.less';
import
{
computed
,
defineComponent
,
onBeforeUnmount
,
onMounted
,
PropType
}
from
'vue'
;
import
{
computed
,
defineComponent
,
onBeforeUnmount
,
onMounted
,
PropType
}
from
'vue'
;
import
{
RouteContextProps
,
useRouteContext
}
from
'../RouteContext'
;
import
{
RouteContextProps
,
useRouteContext
}
from
'../RouteContext'
;
import
{
getMenuFirstChildren
}
from
'../utils'
;
import
{
getMenuFirstChildren
,
getPropsSlot
,
getPropsSlotfn
}
from
'../utils'
;
import
type
{
CustomRender
}
from
'../typings'
;
import
type
{
CustomRender
}
from
'../typings'
;
export
interface
FooterToolbarProps
{
export
interface
FooterToolbarProps
{
extra
?:
CustomRender
|
JSX
.
Element
;
extra
?:
CustomRender
|
JSX
.
Element
;
...
@@ -30,8 +30,7 @@ const footerToolbarProps = {
...
@@ -30,8 +30,7 @@ const footerToolbarProps = {
const
FooterToolbar
=
defineComponent
({
const
FooterToolbar
=
defineComponent
({
name
:
'FooterToolbar'
,
name
:
'FooterToolbar'
,
props
:
footerToolbarProps
,
props
:
footerToolbarProps
,
setup
(
props
,
ctx
)
{
setup
(
props
,
{
slots
})
{
const
{
slots
}
=
ctx
;
const
routeContext
=
useRouteContext
();
const
routeContext
=
useRouteContext
();
const
{
getPrefixCls
}
=
routeContext
;
const
{
getPrefixCls
}
=
routeContext
;
const
baseClassName
=
props
.
prefixCls
||
getPrefixCls
(
'footer-bar'
);
const
baseClassName
=
props
.
prefixCls
||
getPrefixCls
(
'footer-bar'
);
...
@@ -63,14 +62,6 @@ const FooterToolbar = defineComponent({
...
@@ -63,14 +62,6 @@ const FooterToolbar = defineComponent({
return
isMobile
?
'100%'
:
`calc(100% -
${
sideWidth
}
px)`
;
return
isMobile
?
'100%'
:
`calc(100% -
${
sideWidth
}
px)`
;
});
});
const
dom
=
()
=>
{
return
(
<>
<
div
class=
{
`${baseClassName}-left`
}
>
{
props
.
extra
}
</
div
>
<
div
class=
{
`${baseClassName}-right`
}
>
{
slots
.
default
?.()
}
</
div
>
</>
);
};
onMounted
(()
=>
{
onMounted
(()
=>
{
routeContext
.
setHasFooterToolbar
&&
routeContext
.
setHasFooterToolbar
(
true
);
routeContext
.
setHasFooterToolbar
&&
routeContext
.
setHasFooterToolbar
(
true
);
});
});
...
@@ -78,20 +69,33 @@ const FooterToolbar = defineComponent({
...
@@ -78,20 +69,33 @@ const FooterToolbar = defineComponent({
routeContext
.
setHasFooterToolbar
&&
routeContext
.
setHasFooterToolbar
(
false
);
routeContext
.
setHasFooterToolbar
&&
routeContext
.
setHasFooterToolbar
(
false
);
});
});
return
()
=>
(
return
()
=>
{
<
div
class=
{
baseClassName
}
style=
{
{
width
:
width
.
value
}
}
>
const
extra
=
getPropsSlotfn
(
slots
,
props
,
'extra'
);
{
props
.
renderContent
const
dom
=
()
=>
{
?
props
.
renderContent
(
return
(
{
<>
...
props
,
<
div
class=
{
`${baseClassName}-left`
}
>
...
routeContext
,
{
typeof
extra
===
'function'
?
extra
()
:
extra
}
leftWidth
:
width
.
value
,
</
div
>
},
<
div
class=
{
`${baseClassName}-right`
}
>
{
slots
.
default
?.()
}
</
div
>
dom
(),
</>
)
);
:
dom
()
}
};
</
div
>
return
(
);
<
div
class=
{
baseClassName
}
style=
{
{
width
:
width
.
value
}
}
>
{
props
.
renderContent
?
props
.
renderContent
(
{
...
props
,
...
routeContext
,
leftWidth
:
width
.
value
,
},
dom
(),
)
:
dom
()
}
</
div
>
);
};
},
},
});
});
...
...
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