Skip to content

Commit 7a7401a

Browse files
author
- -
committed
update README.md
1 parent 5205ae6 commit 7a7401a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,17 @@ export default {
7777
console.log(this.simplemde)
7878
this.simplemde.value('hellow')
7979

80-
// You can catch the following list of events: https://codemirror.net/doc/manual.html#events
81-
this.simplemde.codemirror.on('change', () => {
82-
console.log(this.simplemde.value())
80+
// 'change'事件已经绑定,可以通过@input指定处理器
81+
// 如果需要,你可以自行绑定这个列表中的其他事件: https://codemirror.net/doc/manual.html#events
82+
this.simplemde.codemirror.on('beforeChange', (instance, changeObj) => {
83+
// do some things
8384
})
8485

85-
// Removing SimpleMDE from textarea
86+
// 移除SimpleMDE,组件销毁时会自动调用
8687
this.simplemde.toTextArea()
8788
this.simplemde = null
8889

89-
// Useful methods
90+
// 一些有用的方法
9091
this.simplemde.isPreviewActive() // returns boolean
9192
this.simplemde.isSideBySideActive() // returns boolean
9293
this.simplemde.isFullscreenActive() // returns boolean

0 commit comments

Comments
 (0)