简体   繁体   English

自动建议库,用于嵌入json模式描述的对象

[英]Auto-suggest libraries for embedding json-schema described objects

We're building an email templating feature into a platform. 我们正在将电子邮件模板功能构建到平台中。 The objects and variables that users can insert into their emails are described by json-schema. 用户可以在电子邮件中插入的对象和变量由json-schema描述。

I figure we can't be the first to be doing this but google hasn't revealed much in the way of libraries that can help with this. 我认为我们不能成为第一个这样做的人,但是google并没有在可以帮助实现此目的的库方面透露太多。

I'm thinking ajv to simply compile all the schemas (the schemas are in multiple files), but then in terms of turning that into UI, so far it seems like we're building from scratch. 我想ajv简单地编译所有的架构(的模式是在多个文件),但随后转向那到UI方面,到目前为止,它似乎就像我们从头开始构建。

Are there JS libraries available that can help with this? 是否有可用的JS库可以帮助解决此问题?

We're using react on the front end. 我们在前端使用react。

I am working on the same problem as well, the most famous library is react-jsonschema-form which published by mozilla, This is a great library using bootstrap. 我也在研究相同的问题,最著名的库是mozilla发布的react-jsonschema-form ,这是一个使用引导程序的很棒的库。

There is another library called react-schema-form which using material-ui right now. 现在还有另一个名为react-schema-form的库,它使用material-ui。

But I want to use my own component lib, finally, I choose the liform-react , which use the redux-form and ajv, The best part of it is that you can customize all the components in there. 但是我想使用我自己的组件库,最后,我选择liform-react ,它们使用redux-form和ajv,最好的部分是您可以在那里自定义所有组件。 the only drawback for now is that you cannot customize the submit button, I just send a PR to the maintainer but they have not merged yet. 现在唯一的缺点是您无法自定义提交按钮,我只是将PR发送给维护者,但它们尚未合并。

Hope these above can help you. 希望以上这些对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM