tiptap: fix copy node

This commit is contained in:
fantasticit 2022-06-17 23:05:02 +08:00
parent 8e728391f2
commit 86fc6bf843
2 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ export const Clipboard = Extension.create<IClipboardOptions>({
if (currentNode) {
event.preventDefault();
copyNode(currentNode);
copyNode(currentNode, extensionThis.editor);
return true;
}
}

View File

@ -5,9 +5,9 @@ import { Fragment, Node } from 'prosemirror-model';
import { debug } from './debug';
export function copyNode(nodeOrNodeName: Node | Fragment<any>);
export function copyNode(nodeOrNodeName: Node | Fragment<any>, editor: Editor);
export function copyNode(nodeOrNodeName: string, editor: Editor);
export function copyNode(nodeOrNodeName: string | Node | Fragment<any>, editor?: Editor) {
export function copyNode(nodeOrNodeName: string | Node | Fragment<any>, editor: Editor) {
let targetNode = null;
if (typeof nodeOrNodeName === 'string') {