Skip to content

Commit

Permalink
fix: 下拉菜单中进入放映后菜单未关闭(#260
Browse files Browse the repository at this point in the history
  • Loading branch information
pipipi-pikachu committed Mar 21, 2024
1 parent 6ac2093 commit ae4656b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Popover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</template>

<script lang="ts" setup>
import { type CSSProperties, onMounted, ref, watch, computed } from 'vue'
import { type CSSProperties, onMounted, onUnmounted, ref, watch, computed } from 'vue'
import tippy, { type Instance, type Placement } from 'tippy.js'
import 'tippy.js/animations/scale.css'
Expand Down Expand Up @@ -46,6 +46,10 @@ watch(() => props.value, () => {
else instance.value.hide()
})
onUnmounted(() => {
if (instance.value) instance.value.destroy()
})
onMounted(() => {
instance.value = tippy(triggerRef.value!, {
content: contentRef.value!,
Expand Down

1 comment on commit ae4656b

@tthallos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

完美~

Please sign in to comment.