feat: 拉取更新 MarkdownEditor 组件代码

This commit is contained in:
Frankie Huang 2025-04-06 04:02:25 +08:00
parent d32e9a83f1
commit 13092e8814

View File

@ -3,7 +3,7 @@
<!-- rewrite Markdown CSS(Cmd Markdown Style) from https://github.com/wakaryry/editorMd -->
<link rel="stylesheet" href="/static/CmdMarkdown/custom.css">
<div id="markdown-editor" />
<div id="markdown-editor"></div>
</template>
<script>
@ -44,6 +44,18 @@ export default {
type: Function,
required: false,
default: () => { }
},
//
onfullscreen: {
type: Function,
required: false,
default: () => { }
},
// 退
onfullscreenExit: {
type: Function,
required: false,
default: () => { }
}
},
data() {
@ -106,18 +118,15 @@ export default {
// editorTheme: (localStorage.editorTheme) ? localStorage.editorThheme : "3024-night",
// previewTheme: (localStorage.previewTheme) ? localStorage.previewTheme : "default",
// 退
// onfullscreen: function () {
// // JS
// var editor = document.getElementById('markdown-editor')
// editor.style['z-index'] = 13
// },
//
// onfullscreenExit: function () {
// // JS
// var editor = document.getElementById('markdown-editor')
// editor.style['z-index'] = 10
// },
onfullscreen: function () {
vm.onfullscreen()
},
// 退
onfullscreenExit: function () {
vm.onfullscreenExit()
},
//
onchange: function () {
@ -165,7 +174,11 @@ export default {
if (!this.isEditorLoadingCompleted()) {
return false
}
editorClient.setMarkdown(newMarkdownCode)
if (newMarkdownCode.length == 0) {
editorClient.clear()
} else {
editorClient.setMarkdown(newMarkdownCode)
}
return true
},
getMarkdownCode() {
@ -184,5 +197,4 @@ export default {
}
</script>
<style scoped>
</style>
<style scoped></style>