提交 842b6636 编写于 作者: A afc163

support Alert[style] and Alert[className]

上级 a3ec948d
......@@ -25,6 +25,7 @@ export interface AlertProps {
showIcon?: boolean;
style?: React.CSSProperties;
prefixCls?: string;
className?: string;
banner?: boolean;
}
......@@ -61,6 +62,7 @@ export default class Alert extends React.Component<AlertProps, any> {
render() {
let {
closable, description, type, prefixCls = 'ant-alert', message, closeText, showIcon, banner,
className = '', style,
} = this.props;
// banner模式默认有 Icon
......@@ -98,6 +100,7 @@ export default class Alert extends React.Component<AlertProps, any> {
[`${prefixCls}-with-description`]: !!description,
[`${prefixCls}-no-icon`]: !showIcon,
[`${prefixCls}-banner`]: !!banner,
[className]: !!className,
});
// closeable when closeText is assigned
......@@ -106,12 +109,13 @@ export default class Alert extends React.Component<AlertProps, any> {
}
return this.state.closed ? null : (
<Animate component=""
<Animate
component=""
showProp="data-show"
transitionName={`${prefixCls}-slide-up`}
onEnd={this.animationEnd}
>
<div data-show={this.state.closing} className={alertCls}>
<div data-show={this.state.closing} className={alertCls} style={style}>
{showIcon ? <Icon className={`${prefixCls}-icon`} type={iconType} /> : null}
<span className={`${prefixCls}-message`}>{message}</span>
<span className={`${prefixCls}-description`}>{description}</span>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册