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

@@ -18,10 +18,10 @@
<script setup lang="ts">
import type { PropType } from 'vue'
import { ref, computed } from 'vue'
import { computed, ref } 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({
@@ -55,9 +55,10 @@ const props = defineProps({
}
})
const popperOptions = computed(() => defu({}, props.popperOptions, { strategy: 'fixed' }))
const popperOptions = computed(() => defu({}, props.popperOptions, $ui.tooltip.popperOptions))
const [trigger, container] = usePopper(popperOptions.value as PopperOptions)
const [trigger, container] = usePopper(popperOptions.value)
const open = ref(false)
</script>