Skip to content

Commit c7f0e13

Browse files
committed
Fix toolbar
1 parent c927cc4 commit c7f0e13

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/components/MarkdownPalettes.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div id="mp-luogu-markdown-editor" class="mp-editor-container" :class="{'mp-full-screen': this.config.fullScreen}">
2+
<div id="mp-luogu-markdown-editor" class="mp-editor-container" :class="{'mp-full-screen': this.fullScreen}">
33
<div id="mp-editor-toolbar" class="mp-editor-toolbar">
44
<toolbar @change="insert" @click="clickToolbar" @input="handleToolbarOperation"
55
:toolbarConfig="editorConfig.toolbarConfig" ref="toolbar"></toolbar>
@@ -112,6 +112,7 @@ export default {
112112
insertCode: null,
113113
editorConfig: config,
114114
editorHeight: '500px',
115+
fullScreen: config.fullScreen,
115116
contentParser: contentParserFactory(config.parsers)
116117
}
117118
},
@@ -146,6 +147,18 @@ export default {
146147
}
147148
this.dialogRequest = request
148149
this.showDialog = true
150+
},
151+
handleToolbarOperation (operation) {
152+
if (operation === 'hide') {
153+
if (this.config.previewDisplay === 'normal') { this.config.previewDisplay = 'hide' } else { this.config.previewDisplay = 'normal' }
154+
}
155+
if (operation === 'fullScreen') {
156+
if (!this.fullScreen) {
157+
this.fullScreen = true
158+
} else {
159+
this.fullScreen = false
160+
}
161+
}
149162
}
150163
},
151164
watch: {

0 commit comments

Comments
 (0)