-
-
Notifications
You must be signed in to change notification settings - Fork 581
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
2 changed files
with
29 additions
and
0 deletions.
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
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,23 @@ | ||
# 自定义插件 | ||
|
||
::: warning | ||
目前仅支持对编辑器实例进行方法的增加及修改,后续扩展更多功能 | ||
::: | ||
|
||
## 开发插件 | ||
|
||
```javascript | ||
export function myPlugin(editor: Editor, options?: Option) { | ||
// 1. 修改方法,详见:src/plugins/copy | ||
editor.command.updateFunction = () => {} | ||
|
||
// 2. 增加方法,详见:src/plugins/markdown | ||
editor.command.addFunction = () => {} | ||
} | ||
``` | ||
|
||
## 使用插件 | ||
|
||
```javascript | ||
instance.add(myPlugin, options?: Option) | ||
``` |