mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:28:37 +08:00
tab需要点击时再加载”
’
This commit is contained in:
parent
0761bf0b7e
commit
2892e63c5f
@ -30,6 +30,8 @@ export interface TabsProps extends RendererProps {
|
|||||||
contentClassName: string;
|
contentClassName: string;
|
||||||
handleSelect?: Function;
|
handleSelect?: Function;
|
||||||
location?: any;
|
location?: any;
|
||||||
|
mountOnEnter?: boolean;
|
||||||
|
unmountOnExit?: boolean;
|
||||||
tabs?: Array<TabProps>;
|
tabs?: Array<TabProps>;
|
||||||
tabRender?: (tab: TabProps, props?: TabsProps) => JSX.Element;
|
tabRender?: (tab: TabProps, props?: TabsProps) => JSX.Element;
|
||||||
}
|
}
|
||||||
@ -203,6 +205,8 @@ export default class Tabs extends React.Component<TabsProps, TabsState> {
|
|||||||
data,
|
data,
|
||||||
mode: dMode,
|
mode: dMode,
|
||||||
tabsMode,
|
tabsMode,
|
||||||
|
mountOnEnter,
|
||||||
|
unmountOnExit
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
if (!Array.isArray(tabs)) {
|
if (!Array.isArray(tabs)) {
|
||||||
@ -232,6 +236,16 @@ export default class Tabs extends React.Component<TabsProps, TabsState> {
|
|||||||
{...tab}
|
{...tab}
|
||||||
key={index}
|
key={index}
|
||||||
eventKey={tab.hash || index}
|
eventKey={tab.hash || index}
|
||||||
|
mountOnEnter={mountOnEnter}
|
||||||
|
unmountOnExit={
|
||||||
|
typeof tab.reload === 'boolean'
|
||||||
|
? tab.reload
|
||||||
|
: (
|
||||||
|
typeof tab.unmountOnExit === 'boolean'
|
||||||
|
? tab.unmountOnExit
|
||||||
|
: unmountOnExit
|
||||||
|
)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{tabRender
|
{tabRender
|
||||||
? tabRender(tab, this.props)
|
? tabRender(tab, this.props)
|
||||||
|
Loading…
Reference in New Issue
Block a user