Skip to content

Commit

Permalink
fix: Teleport types
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Mar 14, 2023
1 parent 6f6b354 commit 0e67fd7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/composables/useDecorators.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { LexicalEditor } from 'lexical'
import type { Component } from 'vue'
import type { DefineComponent } from 'vue'
import { Teleport, computed, h, ref, unref } from 'vue'
import { useMounted } from './useMounted'

export function useDecorators(editor: LexicalEditor) {
const decorators = ref<Record<string, Component>>(editor.getDecorators())
const decorators = ref<Record<string, DefineComponent>>(editor.getDecorators())

useMounted(() => {
return editor.registerDecoratorListener((nextDecorators) => {
decorators.value = nextDecorators as Record<string, Component>
decorators.value = nextDecorators as Record<string, DefineComponent>
})
})

Expand All @@ -22,7 +22,7 @@ export function useDecorators(editor: LexicalEditor) {
const element = editor.getElementByKey(nodeKey)
if (element !== null) {
decoratedTeleports.push(
h(Teleport, {
h(Teleport as unknown as DefineComponent, {
to: element,
}, vueDecorator),
)
Expand Down

0 comments on commit 0e67fd7

Please sign in to comment.