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

@@ -48,7 +48,7 @@ import Avatar from '../elements/Avatar.vue'
import { classNames } from '../../utils'
import { usePopper } from '../../composables/usePopper'
import type { Avatar as AvatarType } from '../../types/avatar'
import type { PopperOptions } from './../types'
import type { PopperOptions } from '../../types'
import $ui from '#build/ui'
const props = defineProps({
@@ -132,9 +132,9 @@ const props = defineProps({
}
})
const popperOptions = computed(() => defu({}, props.popperOptions, { placement: 'bottom-end', strategy: 'fixed' }))
const popperOptions = computed(() => defu({}, props.popperOptions, $ui.dropdown.popperOptions))
const [trigger, container] = usePopper(popperOptions.value)
const [trigger, container] = usePopper(popperOptions.value as PopperOptions)
function resolveItemClass ({ active, disabled }: { active: boolean, disabled: boolean }) {
return classNames(