From 31d756104e232f43171fa3cae5ea3fec093e17bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=92=83=E7=99=BD=5F?= <18511759309@163.com> Date: Thu, 17 Jun 2021 15:51:19 +0800 Subject: [PATCH] Update README.md --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index 4d7f2bc..0c553ce 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,15 @@ - [内容回显](#options) - [顶部工具栏配置](#toolsoptions) +### v0.3 + +2021-06-15 v0.3更新,添加功能: + +- [focus事件](#) +- [blur事件](#) +- [ctrl+enter/command+enter快捷键](#) +- [夜间模式](#) + # 使用 1. 通过script标签引入 @@ -54,6 +63,7 @@ new MdEditor({ | 属性 | 说明 | 类型 | 默认值 | | ------ | ------ | ------ | ------ | +| dark | 夜间模式 | Boolean | false | borderColor | 编辑器边框默认颜色 | String | "#dbdbdb" | borderColorActive | 编辑器边框激活颜色 | String | "#409eff" | textColor | 编辑器文字默认颜色 | String | "#303030" @@ -76,6 +86,32 @@ new MdEditor({ | fullScreen | 全屏模式 | Boolean | true +# onFocus +编辑器获取焦点时触发 + + +```js +new MdEditor({ + ..., + onFocus: function(res) { + console.log(res) // { text: "...", html: "..." } + } +}) +``` + +# onBlur +编辑器失去焦点时触发 + + +```js +new MdEditor({ + ..., + onBlur: function(res) { + console.log(res) // { text: "...", html: "..." } + } +}) +``` + # onChange 用于获取markdown内容及编译后的html内容 -- GitLab