feat: 拉取更新 MarkdownEditor 组件代码
This commit is contained in:
parent
d32e9a83f1
commit
13092e8814
@ -3,7 +3,7 @@
|
|||||||
<!-- rewrite Markdown CSS(Cmd Markdown Style) from https://github.com/wakaryry/editorMd -->
|
<!-- rewrite Markdown CSS(Cmd Markdown Style) from https://github.com/wakaryry/editorMd -->
|
||||||
<link rel="stylesheet" href="/static/CmdMarkdown/custom.css">
|
<link rel="stylesheet" href="/static/CmdMarkdown/custom.css">
|
||||||
|
|
||||||
<div id="markdown-editor" />
|
<div id="markdown-editor"></div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -44,6 +44,18 @@ export default {
|
|||||||
type: Function,
|
type: Function,
|
||||||
required: false,
|
required: false,
|
||||||
default: () => { }
|
default: () => { }
|
||||||
|
},
|
||||||
|
// 全屏编辑器时,执行该函数
|
||||||
|
onfullscreen: {
|
||||||
|
type: Function,
|
||||||
|
required: false,
|
||||||
|
default: () => { }
|
||||||
|
},
|
||||||
|
// 退出全屏时,执行该函数
|
||||||
|
onfullscreenExit: {
|
||||||
|
type: Function,
|
||||||
|
required: false,
|
||||||
|
default: () => { }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -106,18 +118,15 @@ export default {
|
|||||||
// editorTheme: (localStorage.editorTheme) ? localStorage.editorThheme : "3024-night",
|
// editorTheme: (localStorage.editorTheme) ? localStorage.editorThheme : "3024-night",
|
||||||
// previewTheme: (localStorage.previewTheme) ? localStorage.previewTheme : "default",
|
// previewTheme: (localStorage.previewTheme) ? localStorage.previewTheme : "default",
|
||||||
|
|
||||||
// 退出全屏
|
|
||||||
// onfullscreen: function () {
|
|
||||||
// // 原生JS修改层级
|
|
||||||
// var editor = document.getElementById('markdown-editor')
|
|
||||||
// editor.style['z-index'] = 13
|
|
||||||
// },
|
|
||||||
// 全屏
|
// 全屏
|
||||||
// onfullscreenExit: function () {
|
onfullscreen: function () {
|
||||||
// // 原生JS修改层级
|
vm.onfullscreen()
|
||||||
// var editor = document.getElementById('markdown-editor')
|
},
|
||||||
// editor.style['z-index'] = 10
|
|
||||||
// },
|
// 退出全屏
|
||||||
|
onfullscreenExit: function () {
|
||||||
|
vm.onfullscreenExit()
|
||||||
|
},
|
||||||
|
|
||||||
// 监听更新,更新父组件值
|
// 监听更新,更新父组件值
|
||||||
onchange: function () {
|
onchange: function () {
|
||||||
@ -165,7 +174,11 @@ export default {
|
|||||||
if (!this.isEditorLoadingCompleted()) {
|
if (!this.isEditorLoadingCompleted()) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if (newMarkdownCode.length == 0) {
|
||||||
|
editorClient.clear()
|
||||||
|
} else {
|
||||||
editorClient.setMarkdown(newMarkdownCode)
|
editorClient.setMarkdown(newMarkdownCode)
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
getMarkdownCode() {
|
getMarkdownCode() {
|
||||||
@ -184,5 +197,4 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
</style>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user