Skip to content

Commit

Permalink
fix(Popover): add missing onMounted import
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Apr 11, 2022
1 parent 2eb2fea commit 656b6e1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/runtime/components/overlays/Popover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</template>

<script>
import { ref } from 'vue'
import { ref, onMounted } from 'vue'
import { Popover, PopoverButton, PopoverPanel } from '@headlessui/vue'
import { usePopper } from '../../utils'
Expand Down Expand Up @@ -91,15 +91,18 @@ export default {
})
const popoverApi = ref(null)
let openTimeout = null
let closeTimeout = null
onMounted(() => {
setTimeout(() => {
const popoverProvides = trigger.value?.$.provides
const popoverProvidesSymbols = Object.getOwnPropertySymbols(popoverProvides)
popoverApi.value = popoverProvidesSymbols.length && popoverProvides[popoverProvidesSymbols[0]]
}, 0)
})
function onMouseOver () {
if (props.mode !== 'hover' || !popoverApi.value) {
return
Expand All @@ -118,6 +121,7 @@ export default {
openTimeout = null
}, 200)
}
function onMouseLeave () {
if (props.mode !== 'hover' || !popoverApi.value) {
return
Expand Down

1 comment on commit 656b6e1

@vercel
Copy link

@vercel vercel bot commented on 656b6e1 Apr 11, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

ui – ./

ui-nuxtlabs.vercel.app
nuxthq-ui.vercel.app
ui-git-dev-nuxtlabs.vercel.app

Please sign in to comment.