import{e as s,o as t,G as a}from"./vendor.9cc7b6f2.js";const n={class:"markdown-body"},e=[a('
文本框内输入或编辑文字,支持限制输入数量。
import { createApp } from 'vue';\n//vue\nimport { TextArea } from '@nutui/nutui';\n//taro\nimport { TextArea } from '@nutui/nutui-taro';\n\nconst app = createApp();\napp.use(TextArea);\n\n<nut-textarea v-model="value" />\nimport { ref } from 'vue';\n\nexport default {\n setup() {\n const value = ref('');\n return { value };\n },\n};\n<nut-textarea v-model="value" limit-show max-length="20" />\n<nut-textarea v-model="value" rows="10" autosize />\n<nut-textarea readonly model-value="textarea直读状态" />\n<nut-textarea disabled model-value="textarea禁用状态" limit-show max-length="20" />\n| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| v-model | 输入值,支持双向绑定 | String | - |
| placeholder | 设置占位提示文字 | String | '请输入内容' |
| max-length | 限制最长输入字符 | String、Number | - |
| rows | textarea的高度 | String、Number | 2 |
| limit-show | textarea是否展示输入字符。须配合max-length使用 | Boolean | false |
| autosize | 高度是否可拉伸 | Boolean | false |
| text-align | 文本位置,可选值left,center,right | String | left |
| readonly | 只读属性 | Boolean | false |
| disabled | 禁用属性 | Boolean | false |
| 名称 | 说明 | 回调参数 |
|---|---|---|
| change | 输入框值改变时触发 | value |
| focus | 聚焦时触发 | event |
| blur | 失焦时触发 | {value,event} |