Skip to content

Commit

Permalink
feat(Input): add api hasBorder for TextArea. Close #266
Browse files Browse the repository at this point in the history
  • Loading branch information
bindoon committed Mar 22, 2019
1 parent 7ca109c commit d3c8e23
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/input/textarea.jsx
Expand Up @@ -37,6 +37,10 @@ const hiddenStyle = {
export default class TextArea extends Base {
static propTypes = {
...Base.propTypes,
/**
* 是否有边框
*/
hasBorder: PropTypes.bool,
/**
* 状态
* @enumdesc 错误
Expand All @@ -54,6 +58,7 @@ export default class TextArea extends Base {

static defaultProps = {
...Base.defaultProps,
hasBorder: true,
rows: 4,
autoHeight: false,
};
Expand Down Expand Up @@ -183,10 +188,19 @@ export default class TextArea extends Base {
}

render() {
const { rows, style, className, autoHeight, prefix, rtl } = this.props;
const {
rows,
style,
className,
autoHeight,
prefix,
rtl,
hasBorder,
} = this.props;

const cls = classNames(this.getClass(), {
[`${prefix}input-textarea`]: true,
[`${prefix}noborder`]: !hasBorder,
[className]: !!className,
});

Expand Down

0 comments on commit d3c8e23

Please sign in to comment.