diff --git a/doc/cn/markdown.md b/doc/cn/markdown.md index bb7e09939..5674ddba3 100644 --- a/doc/cn/markdown.md +++ b/doc/cn/markdown.md @@ -4,23 +4,23 @@ #### 方法1 通过全局引入的mavonEditor获取 ```javascript - import mavonEditor from 'mavon-editor' - Vue.use(mavonEditor) + import MavonEditor from 'mavon-editor' + Vue.use(MavonEditor) ... - mavonEditor.markdownIt + const markdownIt = MavonEditor.mavonEditor.getMarkdownIt() ``` #### 方法2 通过局部引入的mavonEditor获取 ```javascript - import {mavonEditor} from 'mavon-editor' - mavonEditor.getMarkdownIt() + import { mavonEditor } from 'mavon-editor' + const markdownIt = mavonEditor.getMarkdownIt() ``` #### 方法3 通过mavonEditor的实例获取 ```javascript ... - this.refs.md.markdownIt + const markdownIt = this.refs.md.getMarkdownIt() ``` ### 使用markdown-it对象 @@ -33,32 +33,3 @@ ``` > [更多设置参考markdown-it...](https://github.com/markdown-it/markdown-it) - -### 简单示例 -仅使用mavonEditor的markdown渲染功能。 - -> 注意:`class="markdown-body"` 是必要的,否则CSS样式会于预览的不一样 - -```html - - - -``` diff --git a/doc/en/markdown.md b/doc/en/markdown.md index f01dccfbc..a8b6a26f3 100644 --- a/doc/en/markdown.md +++ b/doc/en/markdown.md @@ -4,23 +4,23 @@ #### method 1: Global Registration ```javascript - import mavonEditor from 'mavon-editor' - Vue.use(mavonEditor) + import MavonEditor from 'mavon-editor' + Vue.use(MavonEditor) ... - mavonEditor.markdownIt + const markdownIt = MavonEditor.mavonEditor.getMarkdownIt() ``` #### method 2: Local Registration ```javascript import {mavonEditor} from 'mavon-editor' - mavonEditor.getMarkdownIt() + const markdownIt = mavonEditor.getMarkdownIt() ``` #### method 3: Use mavonEditor ref ```javascript ... - this.refs.md.markdownIt + const markdownIt = this.refs.md.getMarkdownIt() ``` ### Use markdown-it object @@ -33,32 +33,3 @@ ``` > [markdown-it API](https://github.com/markdown-it/markdown-it) - -### Simple example -Only use the markdown rendering function of mavonEditor. - -> Notice:`class="markdown-body"` is necessary, or the CSS style will be different from the preview - -```html - - - -``` diff --git a/src/dev/demo.vue b/src/dev/demo.vue index fa5e04624..99e591d39 100644 --- a/src/dev/demo.vue +++ b/src/dev/demo.vue @@ -3,10 +3,12 @@
+
@@ -14,12 +16,14 @@ +