mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 06:03:22 +08:00
rename VueRenderer to VueNodeViewRenderer
This commit is contained in:
parent
58b7aa7baa
commit
34f6a0d9ce
@ -16,7 +16,7 @@ function getComponentFromElement(element: HTMLElement): Vue {
|
|||||||
return element.__vue__
|
return element.__vue__
|
||||||
}
|
}
|
||||||
|
|
||||||
interface VueRendererOptions {
|
interface VueNodeViewRendererOptions {
|
||||||
stopEvent: ((event: Event) => boolean) | null,
|
stopEvent: ((event: Event) => boolean) | null,
|
||||||
update: ((node: ProseMirrorNode, decorations: Decoration[]) => boolean) | null,
|
update: ((node: ProseMirrorNode, decorations: Decoration[]) => boolean) | null,
|
||||||
}
|
}
|
||||||
@ -39,12 +39,12 @@ class VueNodeView implements NodeView {
|
|||||||
|
|
||||||
isDragging = false
|
isDragging = false
|
||||||
|
|
||||||
options: VueRendererOptions = {
|
options: VueNodeViewRendererOptions = {
|
||||||
stopEvent: null,
|
stopEvent: null,
|
||||||
update: null,
|
update: null,
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(component: Vue | VueConstructor, props: NodeViewRendererProps, options?: Partial<VueRendererOptions>) {
|
constructor(component: Vue | VueConstructor, props: NodeViewRendererProps, options?: Partial<VueNodeViewRendererOptions>) {
|
||||||
this.options = { ...this.options, ...options }
|
this.options = { ...this.options, ...options }
|
||||||
this.editor = props.editor
|
this.editor = props.editor
|
||||||
this.extension = props.extension
|
this.extension = props.extension
|
||||||
@ -314,7 +314,7 @@ class VueNodeView implements NodeView {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function VueRenderer(component: Vue | VueConstructor, options?: Partial<VueRendererOptions>): NodeViewRenderer {
|
export default function VueNodeViewRenderer(component: Vue | VueConstructor, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer {
|
||||||
return (props: NodeViewRendererProps) => {
|
return (props: NodeViewRendererProps) => {
|
||||||
// try to get the parent component
|
// try to get the parent component
|
||||||
// this is important for vue devtools to show the component hierarchy correctly
|
// this is important for vue devtools to show the component hierarchy correctly
|
@ -1,3 +1,3 @@
|
|||||||
export * from '@tiptap/core'
|
export * from '@tiptap/core'
|
||||||
export { default as VueRenderer } from './VueRenderer'
|
export { default as VueNodeViewRenderer } from './VueNodeViewRenderer'
|
||||||
export { default as EditorContent } from './components/EditorContent'
|
export { default as EditorContent } from './components/EditorContent'
|
||||||
|
Loading…
Reference in New Issue
Block a user