Merge pull request #78 from catchonme/master

tabs修改id方式
This commit is contained in:
liaoxuezhi 2019-06-11 19:54:16 +08:00 committed by GitHub
commit b780c2fb84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 18 deletions

View File

@ -27,7 +27,7 @@ exports[`Renderer:tabs 1`] = `
>
<div
class="a-Tabs"
id="1560051753185"
id="0"
>
<ul
class="a-Tabs-links nav"
@ -38,10 +38,10 @@ exports[`Renderer:tabs 1`] = `
role="presentation"
>
<a
aria-controls="1560051753185-pane-0"
aria-controls="0-pane-0"
aria-selected="true"
href="#"
id="1560051753185-tab-0"
id="0-tab-0"
role="tab"
>
基本配置
@ -52,10 +52,10 @@ exports[`Renderer:tabs 1`] = `
role="presentation"
>
<a
aria-controls="1560051753185-pane-1"
aria-controls="0-pane-1"
aria-selected="false"
href="#"
id="1560051753185-tab-1"
id="0-tab-1"
role="tab"
tabindex="-1"
>
@ -68,9 +68,9 @@ exports[`Renderer:tabs 1`] = `
>
<div
aria-hidden="false"
aria-labelledby="1560051753185-tab-0"
aria-labelledby="0-tab-0"
class="fade tab-pane active in"
id="1560051753185-pane-0"
id="0-pane-0"
role="tabpanel"
>
<span
@ -83,9 +83,9 @@ exports[`Renderer:tabs 1`] = `
</div>
<div
aria-hidden="true"
aria-labelledby="1560051753185-tab-1"
aria-labelledby="0-tab-1"
class="fade tab-pane"
id="1560051753185-pane-1"
id="0-pane-1"
role="tabpanel"
>
<div

View File

@ -72,12 +72,25 @@
}
}
&-arrowZone {
&-optionArrowRight {
width: px2rem(32px);
height: $Form-input-height;
line-height: $Form-input-height;
cursor: pointer;
float: right;
text-align: center;
position: relative;
svg {
width: px2rem(20px);
height: px2rem(20px);
position: absolute;
top: 50%;
left: 50%;
right: 50%;
transform: translate(-50%, -50%);
fill: $Form-input-iconColor;
}
}
&-menuOuter,
@ -131,9 +144,4 @@
padding: 0;
margin: 0;
}
&-optionArrowRight:before {
content: "\e63b";
font-family: "iconfont" !important;
}
}

View File

@ -5,7 +5,7 @@ import Overlay from '../../components/Overlay';
import Checkbox from '../../components/Checkbox';
import PopOver from '../../components/PopOver';
import {RootCloseWrapper} from 'react-overlays';
import {closeIcon} from '../../components/icons';
import {closeIcon, rightArrowIcon} from '../../components/icons';
import {autobind, flattenTree} from '../../utils/helper'
import {
@ -218,7 +218,7 @@ export default class NestedSelectControl extends React.Component<NestedSelectPro
>
{option.label}
</Checkbox>
{option.children ? (<span className={cx('NestedSelect-arrowZone')}><span className={cx('NestedSelect-optionArrowRight')}></span></span>) : null}
{option.children ? (<div className={cx('NestedSelect-optionArrowRight')}>{rightArrowIcon}</div>) : null}
{option.children && option.children.length ? this.renderOptions(option.children, true, cascade ? false : uncheckable || multiple && checked) : null}
</div>
)

View File

@ -30,6 +30,8 @@ export interface TabsState {
prevKey: any;
}
let tabCount = 0;
export default class Tabs extends React.Component<TabsProps, TabsState> {
static defaultProps: Partial<TabsProps> = {
className: '',
@ -38,7 +40,7 @@ export default class Tabs extends React.Component<TabsProps, TabsState> {
unmountOnExit: false,
};
id = Date.now() + '';
id = '' + tabCount++;
constructor(props: TabsProps) {
super(props);