From 6fe2949ef212931190a50c0c04f8ad34b9b97926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=9D=A8?= <1711467488@qq.com> Date: Fri, 23 Feb 2018 19:25:13 +0800 Subject: [PATCH] no message Former-commit-id: d4343037d7ebeda47955c74ab71329e9c3bd4acd Former-commit-id: 79d1079b8e799ec1e7443ff27fbb93f76e5fb99b Former-commit-id: 7ecb5f3c781cd79cef4e763afa2980b193bf8d97 --- src/components/core/SimpleMDE/index.vue | 3 +++ .../demo/components/editor/simpleMDE/demo.vue | 22 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/components/core/SimpleMDE/index.vue b/src/components/core/SimpleMDE/index.vue index b60e0d59..14c7ad34 100644 --- a/src/components/core/SimpleMDE/index.vue +++ b/src/components/core/SimpleMDE/index.vue @@ -53,6 +53,9 @@ export default { // 挂载元素 element: this.$refs.mde }) + this.mde.codemirror.on('change', () => { + this.$emit('input', this.mde.value()) + }) } } } diff --git a/src/pages/demo/components/editor/simpleMDE/demo.vue b/src/pages/demo/components/editor/simpleMDE/demo.vue index 9bc5d2fd..d29211ee 100644 --- a/src/pages/demo/components/editor/simpleMDE/demo.vue +++ b/src/pages/demo/components/editor/simpleMDE/demo.vue @@ -6,10 +6,30 @@ title="基本示例" url="https://github.com/sparksuite/simplemde-markdown-editor"> - + + +
{{text}}
+ + + +