首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在带有装饰组件的mui输入上显示错误消息

在带有装饰组件的mui输入上显示错误消息
EN

Stack Overflow用户
提问于 2022-04-24 08:50:24
回答 1查看 751关注 0票数 0

我有下面的梅组件,它呈现和输入装饰。这是示例

代码语言:javascript
复制
<FormControl fullWidth sx={{ m: 1 }} variant="standard">
                  <InputLabel htmlFor="standard-adornment-amount">
                    Paid Fees
                  </InputLabel>
                  <Input
                    {...field}
                    name="paidFees"
                    id="standard-adornment-amount"
                    error={Boolean(errors["paidFees"])}
                    startAdornment={
                      <InputAdornment position="start">₹</InputAdornment>
                    }
                  />
                </FormControl>

输入API中,它接受error支持,但是没有传递helperText来显示错误消息的道具。

EN

回答 1

Stack Overflow用户

发布于 2022-04-25 03:50:46

也许您可以改为使用TextField而不是输入。下面是您可以尝试的TextField代码示例。

代码语言:javascript
复制
<TextField
 error
 id="outlined-error-helper-text"
 label="Paid Fees"
 helperText="Incorrect fees."
/>

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71986842

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档