Unverified Commit 53850046 authored by Sendya's avatar Sendya

fix: page-container footer props

parent 91146d43
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, Tag, message } from 'ant-design-vue'; import { Button, Descriptions, Space, Statistic, Tag, message } from 'ant-design-vue';
import { PageContainer } from '../src/PageContainer'; import { PageContainer } from '../src/';
import { LikeOutlined } from '@ant-design/icons-vue'; import { LikeOutlined } from '@ant-design/icons-vue';
import './index.less'; import './index.less';
...@@ -33,6 +33,12 @@ const App = defineComponent({ ...@@ -33,6 +33,12 @@ const App = defineComponent({
<PageContainer <PageContainer
title="Title" title="Title"
subTitle="This is a subtitle" subTitle="This is a subtitle"
footer={[
<Button key="3">重置</Button>,
<Button key="2" type="primary">
提交
</Button>,
]}
breadcrumb={{ routes }} breadcrumb={{ routes }}
onBack={() => message.info('@back click')} onBack={() => message.info('@back click')}
tags={['Tag 1', 'Tag 2'].map(tag => ( tags={['Tag 1', 'Tag 2'].map(tag => (
...@@ -65,6 +71,7 @@ const App = defineComponent({ ...@@ -65,6 +71,7 @@ const App = defineComponent({
tabList={[ tabList={[
{ key: '1', tab: 'Details' }, { key: '1', tab: 'Details' },
{ key: '2', tab: 'Rule' }, { key: '2', tab: 'Rule' },
{ key: '3', tab: 'Disabled', disabled: true },
]} ]}
tabProps={{ tabProps={{
type: 'card', type: 'card',
...@@ -73,12 +80,6 @@ const App = defineComponent({ ...@@ -73,12 +80,6 @@ const App = defineComponent({
onTabChange={(key: string) => { onTabChange={(key: string) => {
state.tabActiveKey = key; state.tabActiveKey = key;
}} }}
footer={[
<Button key="3">重置</Button>,
<Button key="2" type="primary">
提交
</Button>,
]}
> >
<div>Page Content</div> <div>Page Content</div>
</PageContainer> </PageContainer>
......
...@@ -15,6 +15,7 @@ const SimpleDemo = { ...@@ -15,6 +15,7 @@ const SimpleDemo = {
}); });
return () => ( return () => (
<ProLayout <ProLayout
{...appState}
title="Pro Tests" title="Pro Tests"
logo="https://alicdn.antdv.com/v2/assets/logo.1ef800a8.svg" logo="https://alicdn.antdv.com/v2/assets/logo.1ef800a8.svg"
onSelect={(selectedKeys: string[] | false) => { onSelect={(selectedKeys: string[] | false) => {
...@@ -24,6 +25,9 @@ const SimpleDemo = { ...@@ -24,6 +25,9 @@ const SimpleDemo = {
console.log('onOpenKeys', openKeys); console.log('onOpenKeys', openKeys);
openKeys && (appState.openKeys = openKeys); openKeys && (appState.openKeys = openKeys);
}} }}
onCollapse={collapsed => {
appState.collapsed = collapsed;
}}
footerRender={() => <div>custom-footer</div>} footerRender={() => <div>custom-footer</div>}
v-slots={{ v-slots={{
rightContentRender: () => ( rightContentRender: () => (
...@@ -33,7 +37,7 @@ const SimpleDemo = { ...@@ -33,7 +37,7 @@ const SimpleDemo = {
), ),
}} }}
> >
<div>content</div> <div style="min-height: 300px;">content</div>
</ProLayout> </ProLayout>
); );
}, },
......
...@@ -19,6 +19,7 @@ import Spin from 'ant-design-vue/es/spin'; ...@@ -19,6 +19,7 @@ import Spin from 'ant-design-vue/es/spin';
import GridContent from '../GridContent'; import GridContent from '../GridContent';
import FooterToolbar from '../FooterToolbar'; import FooterToolbar from '../FooterToolbar';
import './index.less'; import './index.less';
import { WithFalse } from '../typings';
export interface Tab { export interface Tab {
key: string; key: string;
...@@ -62,7 +63,7 @@ export interface PageContainerProps extends PageHeaderTabConfig, Omit<PageHeader ...@@ -62,7 +63,7 @@ export interface PageContainerProps extends PageHeaderTabConfig, Omit<PageHeader
content?: VNodeChild | JSX.Element; content?: VNodeChild | JSX.Element;
extraContent?: VNodeChild | JSX.Element; extraContent?: VNodeChild | JSX.Element;
prefixCls?: string; prefixCls?: string;
footer?: VNodeChild | VNodeChild[] | JSX.Element; footer?: WithFalse<VNodeChild | VNodeChild[] | JSX.Element>;
ghost?: boolean; ghost?: boolean;
header?: PageHeaderProps | VNodeChild; header?: PageHeaderProps | VNodeChild;
pageHeaderRender?: (props: PageContainerProps) => VNodeChild | JSX.Element; pageHeaderRender?: (props: PageContainerProps) => VNodeChild | JSX.Element;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment