【问题标题】:React Material-UI TextInput with fixed text along with placeholder使用固定文本和占位符反应 Material-UI TextInput
【发布时间】:2020-05-07 15:33:45
【问题描述】:

我想为 TextInput 实现以下 UI。它的末尾应该有一个固定的文本以及一个可以提供输入的占位符。

注意:固定文本不应该是可编辑的。

【问题讨论】:

    标签: reactjs material-ui react-material


    【解决方案1】:

    关于输入装饰的文档:https://material-ui.com/components/text-fields/#input-adornments

    import { TextField, InputAdornment } from "@material-ui/core";
    
    <TextField
        placeholder="00"
        InputProps={{
            endAdornment: <InputAdornment position="end">km</InputAdornment>,
        }}
    />
    

    【讨论】:

      猜你喜欢
      • 2019-02-15
      • 2020-01-11
      • 1970-01-01
      • 2017-02-08
      • 2018-04-22
      • 1970-01-01
      • 2017-02-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多