feat: add tippyOptions prop

This commit is contained in:
Philipp Kühn
2021-04-16 12:42:56 +02:00
parent 398fc7f210
commit 9a56f666a1
10 changed files with 56 additions and 12 deletions

View File

@@ -20,15 +20,21 @@ export const BubbleMenu = defineComponent({
type: Object as PropType<BubbleMenuPluginProps['editor']>,
required: true,
},
tippyOptions: {
type: Object as PropType<BubbleMenuPluginProps['tippyOptions']>,
default: () => ({}),
},
},
setup({ editor }, { slots }) {
setup({ editor, tippyOptions }, { slots }) {
const root = ref<HTMLElement | null>(null)
onMounted(() => {
editor.registerPlugin(BubbleMenuPlugin({
editor,
element: root.value as HTMLElement,
tippyOptions,
}))
})

View File

@@ -20,15 +20,21 @@ export const FloatingMenu = defineComponent({
type: Object as PropType<FloatingMenuPluginProps['editor']>,
required: true,
},
tippyOptions: {
type: Object as PropType<FloatingMenuPluginProps['tippyOptions']>,
default: () => ({}),
},
},
setup({ editor }, { slots }) {
setup({ editor, tippyOptions }, { slots }) {
const root = ref<HTMLElement | null>(null)
onMounted(() => {
editor.registerPlugin(FloatingMenuPlugin({
editor,
element: root.value as HTMLElement,
tippyOptions,
}))
})