mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:48:55 +08:00
feat: textarea 支持设置 readOnly (#1643)
This commit is contained in:
parent
203401cea6
commit
c1e89ecf05
@ -29,7 +29,8 @@ order: 57
|
||||
当做选择器表单项使用时,除了支持 [普通表单项属性表](./formitem#%E5%B1%9E%E6%80%A7%E8%A1%A8) 中的配置以外,还支持下面一些配置
|
||||
|
||||
| 属性名 | 类型 | 默认值 | 说明 |
|
||||
| ------------ | --------- | ------ | ---------------------- |
|
||||
| ------------ | --------- | ------ | -------------------- |
|
||||
| minRows | `number` | | 最小行数 |
|
||||
| maxRows | `number` | | 最大行数 |
|
||||
| trimContents | `boolean` | | 是否去除首尾空白文本。 |
|
||||
| trimContents | `boolean` | | 是否去除首尾空白文本 |
|
||||
| readOnly | `boolean` | | 是否只读 |
|
||||
|
@ -23,6 +23,11 @@ export interface TextareaControlSchema extends FormBaseControl {
|
||||
* 最小行数
|
||||
*/
|
||||
minRows?: number;
|
||||
|
||||
/**
|
||||
* 是否只读
|
||||
*/
|
||||
readOnly?: boolean;
|
||||
}
|
||||
|
||||
export interface TextAreaProps extends FormControlProps {
|
||||
@ -92,8 +97,10 @@ export default class TextAreaControl extends React.Component<
|
||||
disabled,
|
||||
minRows,
|
||||
maxRows,
|
||||
readOnly,
|
||||
name
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<Textarea
|
||||
autoComplete="off"
|
||||
@ -110,6 +117,9 @@ export default class TextAreaControl extends React.Component<
|
||||
: JSON.stringify(value)
|
||||
}
|
||||
placeholder={placeholder}
|
||||
autocorrect="off"
|
||||
spellcheck="false"
|
||||
readOnly={readOnly}
|
||||
minRows={minRows}
|
||||
maxRows={maxRows}
|
||||
onChange={this.handleChange}
|
||||
|
Loading…
Reference in New Issue
Block a user