设置 skin_url
指定 css 路径:
{
...
language: 'zh_CN',
skin_url: '/src/assets/tinymce/skins/ui/oxide',
...
}
但控制台提示:
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8080/src/assets/tinymce/skins/ui/oxide/skin.min.css".
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8080/src/assets/tinymce/skins/ui/oxide/content.min.css".
导致编辑器区域为空白,显示不出来。
在 tinymce-react Issues Skin false does not prevent loading of skins #53 发现解决办法:
- 手动引入 css
在 export default
上面引入:
import 'tinymce/skins/ui/oxide/skin.min.css'
import 'tinymce/skins/ui/oxide/content.inline.min.css'
然后设置初始参数:
{
...
language: 'zh_CN',
content_css: false,
// skin_url: '/src/assets/tinymce/skins/ui/oxide',
...
}
网友评论