feat: add override internal function api #260
This commit is contained in:
@@ -61,6 +61,10 @@ export default defineConfig({
|
||||
{ text: '自定义右键菜单', link: '/guide/contextmenu-custom' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '重写方法',
|
||||
items: [{ text: '重写方法', link: '/guide/override' }]
|
||||
},
|
||||
{
|
||||
text: 'API',
|
||||
items: [{ text: '全局API', link: '/guide/api' }]
|
||||
@@ -140,6 +144,10 @@ export default defineConfig({
|
||||
{ text: 'custom', link: '/en/guide/contextmenu-custom' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Override',
|
||||
items: [{ text: 'override', link: '/en/guide/override' }]
|
||||
},
|
||||
{
|
||||
text: 'Api',
|
||||
items: [{ text: 'api', link: '/en/guide/api' }]
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# Override
|
||||
|
||||
## How to Use
|
||||
|
||||
```javascript
|
||||
import Editor from "@hufe921/canvas-editor"
|
||||
|
||||
const instance = new Editor(container, <IElement[]>data, options)
|
||||
instance.override.overrideFunction = ()=>{}
|
||||
```
|
||||
|
||||
## paste
|
||||
|
||||
Feature: Override internal paste function
|
||||
|
||||
Usage:
|
||||
|
||||
```javascript
|
||||
instance.override.paste = (evt: ClipboardEvent) => void
|
||||
```
|
||||
@@ -0,0 +1,20 @@
|
||||
# 重写方法
|
||||
|
||||
## 使用方式
|
||||
|
||||
```javascript
|
||||
import Editor from "@hufe921/canvas-editor"
|
||||
|
||||
const instance = new Editor(container, <IElement[]>data, options)
|
||||
instance.override.overrideFunction = ()=>{}
|
||||
```
|
||||
|
||||
## paste
|
||||
|
||||
功能:重写粘贴方法
|
||||
|
||||
用法:
|
||||
|
||||
```javascript
|
||||
instance.override.paste = (evt: ClipboardEvent) => void
|
||||
```
|
||||
Reference in New Issue
Block a user