11<template >
2- <div id =" mp-luogu-markdown-editor" class =" mp-editor-container" :class =" {'mp-fullscreen ': this.config.fullscreen }" >
2+ <div id =" mp-luogu-markdown-editor" class =" mp-editor-container" :class =" {'mp-full-screen ': this.config.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 >
2121 'mp-editor-area': this.config.previewDisplay === 'normal',
2222 'mp-editor-area-hide': this.config.previewDisplay === 'hide'
2323 }" >
24- <preview-area v-model =" code" :parsers = " editorConfig.parsers " ref =" previewArea" ></preview-area >
24+ <preview-area v-model =" code" :parser = " contentParser " ref =" previewArea" ></preview-area >
2525 </div >
2626 </div >
2727 <div id =" mp-editor-dialog" >
5858 padding-bottom : 2px ;
5959 }
6060
61- .mp-fullscreen {
61+ .mp-full-screen {
6262 position : fixed ;
6363 z-index : 9997 ;
6464 top : 0 ;
@@ -74,7 +74,8 @@ import PreviewArea from './PreviewArea.vue'
7474import Toolbar from ' ./Toolbar.vue'
7575import EditorDialog from ' ./Dialog.vue'
7676
77- import {defaultConfig , getConfig } from ' ./DefaultConfig'
77+ import { defaultConfig , getConfig } from ' ./DefaultConfig'
78+ import { contentParserFactory } from ' ./ContentParserFactory'
7879
7980export default {
8081 name: ' markdown-palettes' ,
@@ -97,7 +98,8 @@ export default {
9798 dialogRequest: {},
9899 insertCode: null ,
99100 editorConfig: config,
100- editorHeight: config .height
101+ editorHeight: config .height ,
102+ contentParser: contentParserFactory (config .parsers )
101103 }
102104 },
103105 mounted () {
@@ -136,12 +138,12 @@ export default {
136138 if (operation === ' hide' ) {
137139 if (this .config .previewDisplay === ' normal' ) { this .config .previewDisplay = ' hide' } else { this .config .previewDisplay = ' normal' }
138140 }
139- if (operation === ' fullscreen ' ) {
140- if (! this .config .fullscreen ) {
141- this .config .fullscreen = true
141+ if (operation === ' fullScreen ' ) {
142+ if (! this .config .fullScreen ) {
143+ this .config .fullScreen = true
142144 this .editorHeight = (window .innerHeight - this .$refs .toolbar .$el .clientHeight ).toString () + ' px'
143145 } else {
144- this .config .fullscreen = false
146+ this .config .fullScreen = false
145147 this .editorHeight = this .editorConfig .height
146148 }
147149 }
0 commit comments