Vue 应用 tinymce 控制台报 Resource interpreted as Stylesheet but transferred with MIME type text/html 导致编辑器不显示
设置 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',
...
}