项目部署到线上,首次打开预览界面需要12秒左右的时间加载cherry-markdown的js文件,这个文件有些大,请问如何解决 #1470
Answered
by
RSS1102
xiaoniucode
asked this question in
Q&A
-
|
版本:cherry-markdown@0.10.0
这是编辑器预览配置: $(document).ready(function () {
const content = "${(post.content!'')?js_string}"
const cherry = new Cherry({
id: 'editor-preview',
value: content,
engine: {
syntax: {
toc: {
allowMultiToc: true,
},
header: {
anchorStyle: 'none',
},
codeBlock: {
wrap: false,
expandCode: false,
}
},
},
editor: {
defaultModel: 'previewOnly',
keepDocumentScrollAfterInit: true,
},
previewer: {
enablePreviewerBubble: false,
},
nameSpace: "preview",
themeSettings: {
themeList: [
{className: 'default', label: '默认'},
{className: 'dark', label: '暗黑'},
{className: 'light', label: '明亮'},
{className: 'green', label: '清新'},
{className: 'red', label: '热情'},
{className: 'violet', label: '淡雅'},
{className: 'blue', label: '清幽'},
],
mainTheme: "light",
codeBlockTheme: "tomorrow-night"
},
});
})cherry-markdown.min.js: |
Beta Was this translation helpful? Give feedback.
Answered by
RSS1102
Oct 16, 2025
Replies: 1 comment
-
|
你使用 CDN 加载试试呢? https://www.jsdelivr.com/package/npm/cherry-markdown?tab=files&version=0.10.0 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
xiaoniucode
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

你使用 CDN 加载试试呢? https://www.jsdelivr.com/package/npm/cherry-markdown?tab=files&version=0.10.0