From 842b6636a314a06d0ebd8e6c5dbb293e014032d6 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 28 Oct 2016 16:42:26 +0800 Subject: [PATCH] support Alert[style] and Alert[className] --- components/alert/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/alert/index.tsx b/components/alert/index.tsx index dacad434eb..2ecb1bcd4e 100755 --- a/components/alert/index.tsx +++ b/components/alert/index.tsx @@ -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 { 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 { [`${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 { } return this.state.closed ? null : ( - -
+
{showIcon ? : null} {message} {description}