add nodeViewProps, fix #214
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
import {
|
||||
ref,
|
||||
provide,
|
||||
PropType,
|
||||
Component,
|
||||
defineComponent,
|
||||
} from 'vue'
|
||||
@@ -15,6 +16,37 @@ import { Node as ProseMirrorNode } from 'prosemirror-model'
|
||||
import { Editor } from './Editor'
|
||||
import { VueRenderer } from './VueRenderer'
|
||||
|
||||
export const nodeViewProps = {
|
||||
editor: {
|
||||
type: Object as PropType<NodeViewProps['editor']>,
|
||||
required: true,
|
||||
},
|
||||
node: {
|
||||
type: Object as PropType<NodeViewProps['node']>,
|
||||
required: true,
|
||||
},
|
||||
decorations: {
|
||||
type: Object as PropType<NodeViewProps['decorations']>,
|
||||
required: true,
|
||||
},
|
||||
selected: {
|
||||
type: Boolean as PropType<NodeViewProps['selected']>,
|
||||
required: true,
|
||||
},
|
||||
extension: {
|
||||
type: Object as PropType<NodeViewProps['extension']>,
|
||||
required: true,
|
||||
},
|
||||
getPos: {
|
||||
type: Function as PropType<NodeViewProps['getPos']>,
|
||||
required: true,
|
||||
},
|
||||
updateAttributes: {
|
||||
type: Function as PropType<NodeViewProps['updateAttributes']>,
|
||||
required: true,
|
||||
},
|
||||
}
|
||||
|
||||
interface VueNodeViewRendererOptions {
|
||||
stopEvent: ((event: Event) => boolean) | null,
|
||||
update: ((node: ProseMirrorNode, decorations: Decoration[]) => boolean) | null,
|
||||
|
||||
Reference in New Issue
Block a user