---
name: Textarea
title: 多行输入框
category: 表单组件
owner: chenxiao07
---


## 示例

```atom 基础示例
<template>
    <div class="c-container">
        <c-textarea :value="value" @change="onChange" />
    </div>
</template>

<script type="config">
    {
        components: {
            'c-textarea': 'components/Textarea/Textarea',
        },
        data: {
            value: '哈哈'
        }
    }
</script>

<script>
    export default {
        methods: {
            onChange(e) {
                console.log(e.detail);
            }
        }
    };
</script>
```

## API
### Props


名称 | 类型 | 默认值 | 是否必选 | 描述 | 其他
--- | --- | --- | --- | --- | ----
value | string | - | 可选 | 值 | -
name | string | - | 可选 | 名称 | -
autoFocus | boolean | false | 可选 | 自动聚焦，拉起键盘，H5上不一定生效 | -
placeholder | string | - | 可选 | 输入框为空时占位符 | -
disabled | boolean | false | 可选 | 输入框为空时占位符 | -
maxlength | number | 140 | 可选 | 最大输入长度 | -



### Events


- **focus**: 获取焦点时触发

名称 | 类型 | 描述
--- | --- | ---
detail.value | string | 值

- **input**: 输入时触发

名称 | 类型 | 描述
--- | --- | ---
detail.value | string | 值

- **change**: 输入改变时触发

名称 | 类型 | 描述
--- | --- | ---
detail.value | string | 值



