refactoring

This commit is contained in:
Philipp Kühn
2021-03-15 09:00:44 +01:00
parent 385ee1d1f4
commit e765c8e981
10 changed files with 48 additions and 63 deletions

View File

@@ -1,10 +1,10 @@
import { reactive, markRaw, Component } from 'vue'
import { AnyObject } from '@tiptap/core'
import { Editor } from './Editor'
export interface VueRendererOptions {
as?: string,
editor: Editor,
props?: { [key: string]: any },
props?: AnyObject,
}
export class VueRenderer {
@@ -18,7 +18,7 @@ export class VueRenderer {
element: Element
props: { [key: string]: any }
props: AnyObject
constructor(component: Component, { props = {}, editor }: VueRendererOptions) {
this.id = Math.floor(Math.random() * 0xFFFFFFFF).toString()
@@ -44,7 +44,7 @@ export class VueRenderer {
return this.editor.contentComponent?.ctx.$refs[this.id]
}
updateProps(props: { [key: string]: any } = {}) {
updateProps(props: AnyObject = {}) {
Object
.entries(props)
.forEach(([key, value]) => {