mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-19 06:43:16 +08:00
commit
3fba56ec90
@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user