有没有办法为 aor 输入字段使用占位符?
两者之间的主要区别在于占位符在提交时不会显示为值,而默认值会显示。
在 aoe 输入中有占位符的概念吗?如果不是,为什么?
最佳答案
Is there a way to use a placeholder for aor input fields?
是的,有!示例:
<ImageInput source="pictures" label="Related pictures" accept="image/*" placeholder={<p>Drop your file here</p>}>
<ImageField source="src" title="title" />
</ImageInput>
或
<Field name="lat" component="input" type="number" placeholder="latitude" />
这是引用:https://github.com/marmelab/admin-on-rest/blob/master/docs/Inputs.md - 搜索关键字 placeholder
关于javascript - 输入字段的默认值与占位符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49073153/