Merge branch 'main' of github.com:ueberdosis/tiptap into main

This commit is contained in:
Hans Pagel
2021-04-23 21:58:17 +02:00
2 changed files with 10 additions and 2 deletions

View File

@@ -27,10 +27,12 @@ export const BubbleMenu = defineComponent({
},
},
setup({ editor, tippyOptions }, { slots }) {
setup(props, { slots }) {
const root = ref<HTMLElement | null>(null)
onMounted(() => {
const { editor, tippyOptions } = props
editor.registerPlugin(BubbleMenuPlugin({
editor,
element: root.value as HTMLElement,
@@ -39,6 +41,8 @@ export const BubbleMenu = defineComponent({
})
onBeforeUnmount(() => {
const { editor } = props
editor.unregisterPlugin(BubbleMenuPluginKey)
})

View File

@@ -27,10 +27,12 @@ export const FloatingMenu = defineComponent({
},
},
setup({ editor, tippyOptions }, { slots }) {
setup(props, { slots }) {
const root = ref<HTMLElement | null>(null)
onMounted(() => {
const { editor, tippyOptions } = props
editor.registerPlugin(FloatingMenuPlugin({
editor,
element: root.value as HTMLElement,
@@ -39,6 +41,8 @@ export const FloatingMenu = defineComponent({
})
onBeforeUnmount(() => {
const { editor } = props
editor.unregisterPlugin(FloatingMenuPluginKey)
})