Unverified Commit b70b15bd authored by Sendya's avatar Sendya

fix: 3.0.0-beta.6 type

fix: typo
parent fa5a604e
...@@ -19,10 +19,10 @@ const footerToolbarProps = { ...@@ -19,10 +19,10 @@ const footerToolbarProps = {
type: Object as PropType<FooterToolbarProps['extra']>, type: Object as PropType<FooterToolbarProps['extra']>,
}, },
renderContent: { renderContent: {
type: Function as PropType<FooterToolbarProps['renderContent']>, type: [Function, Object] as PropType<FooterToolbarProps['renderContent']>,
}, },
getContainer: { getContainer: {
type: Function as PropType<FooterToolbarProps['getContainer']>, type: [Function, Object] as PropType<FooterToolbarProps['getContainer']>,
}, },
prefixCls: { type: String as PropType<string> }, prefixCls: { type: String as PropType<string> },
}; };
......
import { FunctionalComponent, VNodeChild, computed, unref } from 'vue'; import { computed, FunctionalComponent, unref, VNode, VNodeChild } from 'vue';
/* replace antd ts define */ /* replace antd ts define */
import { TabPaneProps } from './interfaces/TabPane'; import { TabPaneProps } from './interfaces/TabPane';
import { TabBarExtraContent, TabsProps } from './interfaces/Tabs'; import { TabBarExtraContent, TabsProps } from './interfaces/Tabs';
import { PageHeaderProps } from './interfaces/PageHeader'; import { PageHeaderProps } from './interfaces/PageHeader';
import { AffixProps } from './interfaces/Affix'; import { AffixProps } from './interfaces/Affix';
/* replace antd ts define end */ /* replace antd ts define end */
import { useRouteContext, RouteContextProps } from '../RouteContext'; import { RouteContextProps, useRouteContext } from '../RouteContext';
import { getCustomRender } from '../utils'; import { getCustomRender } from '../utils';
import { withInstall } from 'ant-design-vue/es/_util/type'; import { withInstall } from 'ant-design-vue/es/_util/type';
import 'ant-design-vue/es/affix/style'; import 'ant-design-vue/es/affix/style';
...@@ -19,11 +19,11 @@ import Spin from 'ant-design-vue/es/spin'; ...@@ -19,11 +19,11 @@ 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'; import { CustomRender, WithFalse } from '../typings';
export interface Tab { export interface Tab {
key: string; key: string;
tab: string | VNodeChild | JSX.Element; tab: string | VNode | JSX.Element;
} }
export interface PageHeaderTabConfig { export interface PageHeaderTabConfig {
...@@ -59,14 +59,15 @@ export interface PageHeaderTabConfig { ...@@ -59,14 +59,15 @@ export interface PageHeaderTabConfig {
} }
export interface PageContainerProps extends PageHeaderTabConfig, Omit<PageHeaderProps, 'title'> { export interface PageContainerProps extends PageHeaderTabConfig, Omit<PageHeaderProps, 'title'> {
title?: VNodeChild | JSX.Element | false;
content?: VNodeChild | JSX.Element;
extraContent?: VNodeChild | JSX.Element;
prefixCls?: string; prefixCls?: string;
footer?: WithFalse<VNodeChild | VNodeChild[] | JSX.Element>;
title?: WithFalse<VNodeChild | JSX.Element | string>;
content?: CustomRender;
extraContent?: CustomRender;
footer?: VNodeChild | JSX.Element;
ghost?: boolean; ghost?: boolean;
header?: PageHeaderProps | VNodeChild; header?: PageHeaderProps | CustomRender;
pageHeaderRender?: (props: PageContainerProps) => VNodeChild | JSX.Element; pageHeaderRender?: (props: PageContainerProps | Record<string, any>) => VNode | JSX.Element;
affixProps?: AffixProps; affixProps?: AffixProps;
loading?: boolean; loading?: boolean;
} }
...@@ -110,10 +111,10 @@ const renderFooter = ( ...@@ -110,10 +111,10 @@ const renderFooter = (
}; };
const renderPageHeader = ( const renderPageHeader = (
content: VNodeChild | JSX.Element, content: CustomRender,
extraContent: VNodeChild | JSX.Element, extraContent: CustomRender,
prefixedClassName: string, prefixedClassName: string,
): VNodeChild | JSX.Element => { ): VNode | JSX.Element | null => {
if (!content && !extraContent) { if (!content && !extraContent) {
return null; return null;
} }
...@@ -140,7 +141,7 @@ const renderPageHeader = ( ...@@ -140,7 +141,7 @@ const renderPageHeader = (
const defaultPageHeaderRender = ( const defaultPageHeaderRender = (
props: PageContainerProps, props: PageContainerProps,
value: RouteContextProps & { prefixedClassName: string }, value: RouteContextProps & { prefixedClassName: string },
): VNodeChild | JSX.Element => { ): VNode | JSX.Element => {
const { const {
title, title,
tabList, tabList,
......
import { VNodeChild, CSSProperties } from 'vue'; import { VNode, VNodeChild, CSSProperties } from 'vue';
export type ShapeType = 'circle' | 'square'; export type ShapeType = 'circle' | 'square';
export type Size = 'large' | 'small' | 'default'; export type Size = 'large' | 'small' | 'default';
export interface AvatarProps { export interface AvatarProps {
icon?: VNodeChild | JSX.Element; icon?: VNode | JSX.Element;
shape?: ShapeType; shape?: ShapeType;
size?: Size; size?: Size;
src?: string; src?: string;
...@@ -29,3 +29,4 @@ export interface PageHeaderProps { ...@@ -29,3 +29,4 @@ export interface PageHeaderProps {
onBack?: (e: MouseEvent) => void; onBack?: (e: MouseEvent) => void;
ghost?: boolean; ghost?: boolean;
} }
``;
...@@ -67,11 +67,13 @@ export type WithFalse<T> = T | false; ...@@ -67,11 +67,13 @@ export type WithFalse<T> = T | false;
export type CustomRender = export type CustomRender =
| Slot | Slot
| VNode | VNode
| ((...props: any) => Slot) | ((...props: any[]) => Slot)
| ((...props: any) => VNode) | ((...props: any[]) => VNode)
| ((...args: any[]) => VNode) | ((...args: any[]) => VNode)
| VNode[] | VNode[]
| JSX.Element | JSX.Element
| null; | string
| null
| undefined;
export type FormatMessage = (message?: string) => string; export type FormatMessage = (message?: string) => string;
This source diff could not be displayed because it is too large. You can view the blob instead.
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