tabs修改方法名称

This commit is contained in:
catchonme 2019-10-29 12:50:38 +08:00
parent ed1e832c87
commit ba1bdd2f3e
3 changed files with 7 additions and 6 deletions

View File

@ -19,6 +19,7 @@ const transitionStyles: {
export interface TabProps {
title?: string; // 标题
icon?: string;
disabled?: boolean | string;
eventKey: string | number;
tab?: Schema;
className?: string;
@ -34,7 +35,7 @@ export interface TabsProps {
mode?: '' | 'line' | 'card' | 'radio' | 'vertical';
tabsMode?: '' | 'line' | 'card' | 'radio' | 'vertical';
additionBtns?: React.ReactNode;
handleSelect?: Function;
onSelect?: (key: string | number) => void;
classPrefix: string;
classnames: ClassNamesFn;
activeKey: string | number;
@ -50,9 +51,9 @@ export class Tabs extends React.Component<TabsProps> {
contentClassName: ''
};
handleSelect(key: any) {
const {handleSelect} = this.props;
handleSelect && handleSelect(key);
handleSelect(key: string | number) {
const {onSelect} = this.props;
onSelect && onSelect(key);
}
renderNav(child: any, index: number) {

View File

@ -485,7 +485,7 @@ export default class ComboControl extends React.Component<ComboProps> {
<CTabs
mode={tabsStyle}
activeKey={store.activeKey}
handleSelect={this.handleTabSelect}
onSelect={this.handleTabSelect}
additionBtns={
!disabled ? (
<li className={cx(`Tabs-link`)}>

View File

@ -219,7 +219,7 @@ export default class Tabs extends React.Component<TabsProps, TabsState> {
mode={mode}
className={className}
contentClassName={contentClassName}
handleSelect={this.handleSelect}
onSelect={this.handleSelect}
activeKey={this.state.activeKey}
>
{tabs.map((tab, index) =>