Update ImageField on change of TextInput

二次信任 提交于 2020-01-05 17:18:31

问题


Given a SimpleForm:

<SimpleForm>
    <TextInput source="imageUrl" label="Image URL" />
    <ImageField source="imageUrl" label="Image" />
</SimpleForm>

I'd like to have the ImageField update as the user types in the TextInput. Is this somehow possible out of the box, or will I have to wire it up myself?


回答1:


You should probably build a custom input like the one we built for image upload. Instead of the file input, just use a text input and handle the image visualization inside it.



来源:https://stackoverflow.com/questions/47439028/update-imagefield-on-change-of-textinput

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!