tiptapify
Version:
Tiptap3 editor with Vuetify3 menu implementation
13 lines (11 loc) • 473 B
text/typescript
import { Editor, useEditor } from "@tiptap/vue-3";
import { editorExtensions } from "@tiptapify/components/editorExtensions";
import { ShallowRef } from "vue";
export function getTiptapEditor (content: any, placeholder: string, slashCommands: boolean = true): ShallowRef<Editor | undefined> {
const extensions = editorExtensions(placeholder, slashCommands)
const editor: ShallowRef<Editor | undefined> = useEditor({
content,
extensions,
})
return editor
}