【问题标题】:Multi-Line Placeholder Text in Material UIMaterial UI 中的多行占位符文本
【发布时间】:2019-02-15 04:08:24
【问题描述】:

我正在为我正在开发的 React 应用程序使用 Material UI。

我正在使用TextField 组件,我需要一个用于文本区域的多行占位符。我目前有:

       <TextField
            id="details"
            fullWidth={true}
            multiline={true}
            rows={5}
            label="Give us some additional details:"
            placeholder="- Tell us about this project \n - What skills are you looking for ? &#10; - What tools do you need an expert in? &#10; - What is your timeline?"
        />

它需要显示为:

- Tell us about this project 
- What skills are you looking for ?
- What tools do you need an expert in? 
- What is your timeline?

您可以看到我尝试了&amp;#10;\n 都无济于事。任何提示表示赞赏!

【问题讨论】:

    标签: javascript reactjs material-design material-ui placeholder


    【解决方案1】:

    您需要使用简单的占位符收缩启用:

    这里是工作代码和框:Multiline Placeholder

    【讨论】:

      猜你喜欢
      • 2018-10-20
      • 1970-01-01
      • 2020-01-11
      • 2017-02-08
      • 2020-05-07
      • 1970-01-01
      • 2019-06-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多