fix: revert type changes for useEditor in vue-3 package
This commit is contained in:
@@ -1,15 +1,9 @@
|
|||||||
import {
|
import { onMounted, onBeforeUnmount, shallowRef } from 'vue'
|
||||||
onMounted,
|
|
||||||
onBeforeUnmount,
|
|
||||||
shallowRef,
|
|
||||||
Ref,
|
|
||||||
} from 'vue'
|
|
||||||
import { EditorOptions } from '@tiptap/core'
|
import { EditorOptions } from '@tiptap/core'
|
||||||
import { Editor } from './Editor'
|
import { Editor } from './Editor'
|
||||||
|
|
||||||
// We set a custom return type. Otherwise TypeScript will throw TS4023. Not sure why.
|
export const useEditor = (options: Partial<EditorOptions> = {}) => {
|
||||||
export const useEditor = (options: Partial<EditorOptions> = {}): Ref<Editor> => {
|
const editor = shallowRef<Editor>()
|
||||||
const editor = shallowRef<Editor>() as Ref<Editor>
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
editor.value = new Editor(options)
|
editor.value = new Editor(options)
|
||||||
|
|||||||
Reference in New Issue
Block a user