Merge pull request #15310 from ztplz/static

style: 🏷 static tags
This commit is contained in:
偏右 2019-04-16 11:36:28 +08:00 committed by GitHub
commit 3fba56ec90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -6,8 +6,8 @@ import Icon from '../icon';
import CheckableTag from './CheckableTag';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import { PresetColorTypes } from '../_util/colors';
import Wave from '../_util/wave';
import warning from '../_util/warning';
import Wave from '../_util/wave';
export { CheckableTagProps } from './CheckableTag';
@ -116,14 +116,21 @@ class Tag extends React.Component<TagProps, TagState> {
renderTag = (configProps: ConfigConsumerProps) => {
const { prefixCls: customizePrefixCls, children, ...otherProps } = this.props;
const isNeedWave =
'onClick' in otherProps || (children && (children as React.ReactElement<any>).type === 'a');
const divProps = omit(otherProps, ['onClose', 'afterClose', 'color', 'visible', 'closable']);
return (
return isNeedWave ? (
<Wave>
<div {...divProps} className={this.getTagClassName(configProps)} style={this.getTagStyle()}>
{children}
{this.renderCloseIcon()}
</div>
</Wave>
) : (
<div {...divProps} className={this.getTagClassName(configProps)} style={this.getTagStyle()}>
{children}
{this.renderCloseIcon()}
</div>
);
};

View File

@ -16,7 +16,7 @@
background: @tag-default-bg;
border: @border-width-base @border-style-base @border-color-base;
border-radius: @border-radius-base;
cursor: pointer;
cursor: default;
opacity: 1;
transition: all 0.3s @ease-in-out-circ;