mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-08-06 13:38:49 +08:00
refactor: don’t use destructuring for props
This commit is contained in:
parent
9110258a4c
commit
888cce2e4c
@ -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)
|
||||
})
|
||||
|
||||
|
@ -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)
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user