提交 30238a75 编写于 作者: A afc163

Fix Tag nested bug, close #1111

上级 3e9a5afa
......@@ -36,12 +36,13 @@ class AntTag extends React.Component {
}
render() {
const { prefixCls, closable, color, ...restProps } = this.props;
const { prefixCls, closable, color, className, children, ...restProps } = this.props;
const close = closable ? <Icon type="cross" onClick={this.close.bind(this)} /> : '';
const className = classNames({
const classString = classNames({
[prefixCls]: true,
[`${prefixCls}-${color}`]: !!color,
[`${prefixCls}-close`]: this.state.closing,
[className]: !!className,
});
return (
<Animate component=""
......@@ -50,8 +51,8 @@ class AntTag extends React.Component {
transitionAppear
onEnd={this.animationEnd.bind(this)}>
{this.state.closed ? null : (
<div data-show={!this.state.closing} className={className}>
<span className={`${prefixCls}-text`} {...restProps} />
<div data-show={!this.state.closing} {...restProps} className={classString}>
<span className={`${prefixCls}-text`}>{children}</span>
{close}
</div>
)}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册