mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-27 10:20:42 +01:00
chore: fix popper props merge
This commit is contained in:
@@ -18,7 +18,8 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { Ref, PropType } from 'vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { defu } from 'defu'
|
||||
import { Popover, PopoverButton, PopoverPanel } from '@headlessui/vue'
|
||||
import { usePopper } from '../../composables/usePopper'
|
||||
import type { PopperOptions } from './../types'
|
||||
@@ -54,13 +55,13 @@ const props = defineProps({
|
||||
},
|
||||
popperOptions: {
|
||||
type: Object as PropType<PopperOptions>,
|
||||
default: () => ({
|
||||
strategy: 'fixed'
|
||||
})
|
||||
default: () => {}
|
||||
}
|
||||
})
|
||||
|
||||
const [trigger, container] = usePopper(props.popperOptions)
|
||||
const popperOptions = computed(() => defu({}, props.popperOptions, { strategy: 'fixed' }))
|
||||
|
||||
const [trigger, container] = usePopper(popperOptions.value)
|
||||
|
||||
const popoverApi: Ref<any> = ref(null)
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { PropType } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import { ref, computed } from 'vue'
|
||||
import { defu } from 'defu'
|
||||
import { usePopper } from '../../composables/usePopper'
|
||||
import type { PopperOptions } from './../types'
|
||||
import $ui from '#build/ui'
|
||||
@@ -50,14 +51,14 @@ const props = defineProps({
|
||||
},
|
||||
popperOptions: {
|
||||
type: Object as PropType<PopperOptions>,
|
||||
default: () => ({
|
||||
strategy: 'fixed'
|
||||
})
|
||||
default: () => {}
|
||||
}
|
||||
})
|
||||
|
||||
const popperOptions = computed(() => defu({}, props.popperOptions, { strategy: 'fixed' }))
|
||||
|
||||
const [trigger, container] = usePopper(popperOptions.value)
|
||||
const open = ref(false)
|
||||
const [trigger, container] = usePopper(props.popperOptions)
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
||||
Reference in New Issue
Block a user