mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-11 11:45:15 +08:00
fix vue-3 build
This commit is contained in:
parent
9055026158
commit
b5b9363b49
@ -1,9 +1,15 @@
|
|||||||
import { onMounted, onBeforeUnmount, shallowRef } from 'vue'
|
import {
|
||||||
|
onMounted,
|
||||||
|
onBeforeUnmount,
|
||||||
|
shallowRef,
|
||||||
|
Ref,
|
||||||
|
} from 'vue'
|
||||||
import { EditorOptions } from '@tiptap/core'
|
import { EditorOptions } from '@tiptap/core'
|
||||||
import { Editor } from './Editor'
|
import { Editor } from './Editor'
|
||||||
|
|
||||||
export const useEditor = (options: Partial<EditorOptions> = {}) => {
|
// We set a custom return type. Otherwise TypeScript will throw TS4023. Not sure why.
|
||||||
const editor = shallowRef<Editor>()
|
export const useEditor = (options: Partial<EditorOptions> = {}): Ref<Editor> => {
|
||||||
|
const editor = shallowRef<Editor>() as Ref<Editor>
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
editor.value = new Editor(options)
|
editor.value = new Editor(options)
|
||||||
|
Loading…
Reference in New Issue
Block a user