gpt4 book ai didi

javascript - Draft.js 样式不起作用

转载 作者:太空宇宙 更新时间:2023-11-04 07:54:00 24 4
gpt4 key购买 nike

我正在尝试将 Draft.js 与图像插件一起使用。这是我的问题。我设法让它工作,但没有加载样式,编辑器占据了整个页面,按钮没有样式。

enter image description here

我从提供的 CSS 加载样式

import './Draft.css';
import editorStyles from './editorStyles.css';
import 'draft-js-image-plugin/lib/plugin.css';

但它什么也没做。我正在使用 Create React App,所以 style-loadercss-loader 应该可以正常工作。

感谢您的帮助。

最佳答案

关于draft-js-image-plugin/lib/plugin.css中的样式。看起来像是the plugin documentation中的一个错误.我们可以在那里阅读:

The plugin ships with a default styling available at this location in the installed package: node_modules/draft-js-image-plugin/lib/plugin.css

但是如果我们在 node_modules 目录中检查这个文件,我们会发现这个文件是空的。没有任何样式。

enter image description here

关于其他样式。检查您是否有 Draft.csseditorStyles.css 文件,并且这些文件与您的组件位于同一目录中。你在控制台中有一些错误吗?如果您提供完整的代码,那就太好了。

关于javascript - Draft.js 样式不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47510146/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com