You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
488 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 自定义插件
::: 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)
```