TinyMCE 导入样式失败

问题描述 投票:0回答:1

我通过 npm 包和 vite 使用tinymce 6.8.3。 当像

docs
那样导入 import 'tinymce/themes/silver'; 时,我收到了如图所示的错误。

tinymce
1个回答
0
投票

我遇到了同样的问题,这对我有用:

按照 https://www.tiny.cloud/docs/tinymce/latest/vite-es6-npm/ 的说明进行操作,但更改以下两行:

/* content UI CSS is required */
import contentUiSkinCss from 'tinymce/skins/ui/oxide/content.js';

/* The default content CSS can be changed or replaced with appropriate CSS for the editor content. */
import contentCss from 'tinymce/skins/content/default/content.js';

进入:

/* content UI CSS is required */
import 'tinymce/skins/ui/oxide/content.js';
/* The default content CSS can be changed or replaced with appropriate CSS for the editor content. */
import 'tinymce/skins/content/default/content.js';

并确保将以下两行添加到tinymce初始化中:

skin_url: 'default',
content_css: 'default',
© www.soinside.com 2019 - 2024. All rights reserved.