Javascript material-ui中的文本区域
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46393703/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Text Area in material-ui
提问by Johann Gomes
Could someone help me making a TextField personalization into a TextArea, using material-ui library? I am not finding any parameter that should personalize it into a TextArea: https://github.com/callemall/material-ui/blob/v1-beta/src/TextField/TextField.d.ts
有人可以帮助我使用 material-ui 库将 TextField 个性化设置为 TextArea 吗?我没有找到任何应该将其个性化为 TextArea 的参数:https: //github.com/callemall/material-ui/blob/v1-beta/src/TextField/TextField.d.ts
This is the TextArea:https://material.io/guidelines/components/text-fields.html#text-fields-field-types(CMD/Ctrl + F 'Text area').
这是文本区域:https: //material.io/guidelines/components/text-fields.html#text-fields-field-types(CMD/Ctrl + F '文本区域')。
Text areas are taller than text fields and wrap overflow text onto a new line. They scroll vertically when the cursor reaches the bottom of the field.
文本区域比文本字段高,并将溢出文本换行到新行。当光标到达字段底部时,它们会垂直滚动。
回答by bennygenel
回答by Rishav Kumar
You should use TextareaAutosizeAPI available in material UI.
您应该使用TextareaAutosizeMaterial UI 中可用的 API。
import TextareaAutosize from '@material-ui/core/TextareaAutosize';
// or
import { TextareaAutosize } from '@material-ui/core';**
The following example has all the attributes of TextareaAutosize: https://material-ui.com/components/textarea-autosize/
以下示例具有 TextareaAutosize 的所有属性:https: //material-ui.com/components/textarea-autosize/

