Merge pull request #313 from catchonme/master

tabs 修正方法名称
This commit is contained in:
liaoxuezhi 2019-10-29 14:17:50 +08:00 committed by GitHub
commit 2f8b3e699c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) =>