Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 配置 focus 函数 | ||
|
||
配置`focus`函数之后,用户点击富文本区域会触发`focus`函数执行。 | ||
|
||
```html | ||
<div id="div1"> | ||
<p>欢迎使用 wangEditor 富文本编辑器</p> | ||
</div> | ||
|
||
<script type="text/javascript" src="/wangEditor.min.js"></script> | ||
<script type="text/javascript"> | ||
var E = window.wangEditor | ||
var editor = new E('#div1') | ||
editor.customConfig.focus = function () { | ||
console.log("focus") | ||
} | ||
editor.create() | ||
</script> | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# 配置 blur 函数 | ||
|
||
配置`blur`函数之后,如果当前有手动获取焦点的富文本并且鼠标点击富文本以外的区域,则会触发`blur`函数执行。 | ||
|
||
```html | ||
<div id="div1"> | ||
<p>欢迎使用 wangEditor 富文本编辑器</p> | ||
</div> | ||
|
||
<p>手动触发 onchange 函数执行</p> | ||
<button id="btn1">change</button> | ||
|
||
<script type="text/javascript" src="/wangEditor.min.js"></script> | ||
<script type="text/javascript"> | ||
var E = window.wangEditor | ||
var editor = new E('#div1') | ||
editor.customConfig.blur = function (html) { | ||
// html 即编辑器中的内容 | ||
console.log(html) | ||
} | ||
editor.create() | ||
</script> | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters