From 011dec91f7155346a392e15e2c8f2811b11ecb88 Mon Sep 17 00:00:00 2001 From: Pan Date: Wed, 28 Nov 2018 10:57:15 +0800 Subject: [PATCH] tweak --- src/components/MarkdownEditor/index.vue | 13 ++++++++++++- src/views/components-demo/markdown.vue | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/MarkdownEditor/index.vue b/src/components/MarkdownEditor/index.vue index 5fcdc625..4a6d8b0f 100644 --- a/src/components/MarkdownEditor/index.vue +++ b/src/components/MarkdownEditor/index.vue @@ -12,7 +12,7 @@ import Editor from 'tui-editor' import defaultOptions from './defaultOptions' export default { - name: 'SimplemdeMd', + name: 'MarddownEditor', props: { value: { type: String, @@ -46,6 +46,11 @@ export default { default: 'en_US' // https://github.com/nhnent/tui.editor/tree/master/src/js/langs } }, + data() { + return { + editor: null + } + }, computed: { editorOptions() { const options = Object.assign({}, defaultOptions, this.options) @@ -64,6 +69,12 @@ export default { language(val) { this.destroyEditor() this.initEditor() + }, + height(newValue) { + this.editor.height(newValue) + }, + mode(newValue) { + this.editor.changeMode(newValue) } }, mounted() { diff --git a/src/views/components-demo/markdown.vue b/src/views/components-demo/markdown.vue index 1edb0842..137776bc 100644 --- a/src/views/components-demo/markdown.vue +++ b/src/views/components-demo/markdown.vue @@ -28,7 +28,7 @@
I18n: - +