chore: set popper options in preset (#97)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Baptiste Leproux
2022-10-18 11:13:28 +02:00
committed by GitHub
parent c89c65bd44
commit 5039265097
7 changed files with 36 additions and 18 deletions

View File

@@ -12,7 +12,7 @@
import { PropType, computed, toRef } from 'vue'
import { defu } from 'defu'
import { usePopper } from '../../composables/usePopper'
import type { PopperOptions } from './../types'
import type { PopperOptions } from '../../types'
import $ui from '#build/ui'
const props = defineProps({
@@ -63,9 +63,9 @@ const isOpen = computed({
const virtualElement = toRef(props, 'virtualElement')
const popperOptions = computed(() => defu({}, props.popperOptions, { placement: 'bottom-start', scroll: false }))
const popperOptions = computed(() => defu({}, props.popperOptions, $ui.contextMenu.popperOptions))
const [, container] = usePopper(popperOptions.value, virtualElement)
const [, container] = usePopper(popperOptions.value as PopperOptions, virtualElement)
</script>
<script lang="ts">