React Material-UI 带有固定文本和占位符的 TextInput
React Material-UI TextInput with fixed text along with placeholder
我想为 TextInput 实现以下 UI。它应该在末尾有一个固定的文本以及一个可以给出输入的占位符。
注意:固定文本不应该是可编辑的。
关于输入修饰的文档: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>,
}}
/>
我想为 TextInput 实现以下 UI。它应该在末尾有一个固定的文本以及一个可以给出输入的占位符。
注意:固定文本不应该是可编辑的。
关于输入修饰的文档: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>,
}}
/>