我想在我的元素中使用 draft.js。它有自己的 CSS,我也需要导入它。在documentation据说:
This CSS should be included when rendering the editor, as these styles set defaults for text alignment, spacing, and other important features.
- 如何在呈现组件时包含 Draft.css?我是否将其包含在我的主 index.html 中?
- 还有如何给编辑器一个
id
以便我可以设置它的样式(例如border
、padding
、min -高度
等)
最佳答案
根据您的设置,您应该能够在 index.js 文件中包含或导入 Draft.css。
...
import 'draft-js/dist/Draft.css';
...
关于css - React 中的 Draftjs 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38289858/