File tree 2 files changed +17
-5
lines changed
2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 20
20
v-if =" editor && ! destroyed && ! page .preview ?.enabled && editor .isEditable "
21
21
>
22
22
<menus-context-block v-if =" options.document?.enableBlockMenu" />
23
- <menus-bubble v-if =" options.document?.enableBubbleMenu" />
23
+ <menus-bubble
24
+ v-if =" options.document?.enableBubbleMenu"
25
+ v-show =" !editor?.view?.painter?.enabled && !editor?.isEmpty"
26
+ />
24
27
</template >
25
28
</template >
26
29
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<bubble-menu
3
- v-show =" !editor?.view?.painter?.enabled && !editor?.isEmpty"
4
3
class =" umo-editor-bubble-menu"
5
4
:class =" { assistant }"
6
5
:editor =" editor!"
@@ -46,11 +45,21 @@ const tippyOpitons = $ref<Partial<Instance>>({
46
45
watch (
47
46
() => [assistant .value ],
48
47
(visible : any []) => {
49
- tippyInstance ?.setProps ({
50
- placement: visible .includes (true ) ? ' bottom' : ' top' ,
51
- })
48
+ if (tippyInstance ) {
49
+ tippyInstance ?.setProps ({
50
+ placement: visible .includes (true ) ? ' bottom' : ' top' ,
51
+ })
52
+ }
52
53
},
53
54
)
55
+
56
+ // 销毁 tippy
57
+ onUnmounted (() => {
58
+ if (tippyInstance ) {
59
+ tippyInstance .destroy ()
60
+ tippyInstance = null
61
+ }
62
+ })
54
63
</script >
55
64
56
65
<style lang="less">
You can’t perform that action at this time.
0 commit comments