mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
chore: fix typescript errors (#102)
This commit is contained in:
committed by
GitHub
parent
32922def7d
commit
fc658842bb
@@ -132,9 +132,9 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const popperOptions = computed(() => defu({}, props.popperOptions, $ui.dropdown.popperOptions))
|
||||
const popperOptions = computed<PopperOptions>(() => defu({}, props.popperOptions, $ui.dropdown.popperOptions))
|
||||
|
||||
const [trigger, container] = usePopper(popperOptions.value as PopperOptions)
|
||||
const [trigger, container] = usePopper(popperOptions.value)
|
||||
|
||||
function resolveItemClass ({ active, disabled }: { active: boolean, disabled: boolean }) {
|
||||
return classNames(
|
||||
|
||||
@@ -263,9 +263,9 @@ const props = defineProps({
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const popperOptions = computed(() => defu({}, props.popperOptions, $ui.selectCustom.popperOptions))
|
||||
const popperOptions = computed<PopperOptions>(() => defu({}, props.popperOptions, $ui.selectCustom.popperOptions))
|
||||
|
||||
const [trigger, container] = usePopper(popperOptions.value as PopperOptions)
|
||||
const [trigger, container] = usePopper(popperOptions.value)
|
||||
|
||||
const query = ref('')
|
||||
const searchInput = ref<ComponentPublicInstance<HTMLElement>>()
|
||||
|
||||
@@ -63,9 +63,9 @@ const isOpen = computed({
|
||||
|
||||
const virtualElement = toRef(props, 'virtualElement')
|
||||
|
||||
const popperOptions = computed(() => defu({}, props.popperOptions, $ui.contextMenu.popperOptions))
|
||||
const popperOptions = computed<PopperOptions>(() => defu({}, props.popperOptions, $ui.contextMenu.popperOptions))
|
||||
|
||||
const [, container] = usePopper(popperOptions.value as PopperOptions, virtualElement)
|
||||
const [, container] = usePopper(popperOptions.value, virtualElement)
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
||||
@@ -59,9 +59,9 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const popperOptions = computed(() => defu({}, props.popperOptions, $ui.popover.popperOptions))
|
||||
const popperOptions = computed<PopperOptions>(() => defu({}, props.popperOptions, $ui.popover.popperOptions))
|
||||
|
||||
const [trigger, container] = usePopper(popperOptions.value as PopperOptions)
|
||||
const [trigger, container] = usePopper(popperOptions.value)
|
||||
|
||||
const popoverApi: Ref<any> = ref(null)
|
||||
|
||||
|
||||
@@ -55,9 +55,9 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const popperOptions = computed(() => defu({}, props.popperOptions, $ui.tooltip.popperOptions))
|
||||
const popperOptions = computed<PopperOptions>(() => 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>
|
||||
|
||||
@@ -8,6 +8,7 @@ import offset from '@popperjs/core/lib/modifiers/offset'
|
||||
import preventOverflow from '@popperjs/core/lib/modifiers/preventOverflow'
|
||||
import computeStyles from '@popperjs/core/lib/modifiers/computeStyles'
|
||||
import eventListeners from '@popperjs/core/lib/modifiers/eventListeners'
|
||||
import type { PopperOptions } from '../types'
|
||||
|
||||
export const createPopper = popperGenerator({
|
||||
defaultModifiers: [...defaultModifiers, offset, flip, preventOverflow, computeStyles, eventListeners]
|
||||
@@ -24,7 +25,7 @@ export function usePopper ({
|
||||
resize = true,
|
||||
placement,
|
||||
strategy
|
||||
}, virtualReference: Ref<Object> = null) {
|
||||
}: PopperOptions, virtualReference: Ref<Object> = null) {
|
||||
const reference: Ref<HTMLElement> = ref(null)
|
||||
const popper: Ref<HTMLElement> = ref(null)
|
||||
const instance: Ref<Instance> = ref(null)
|
||||
|
||||
Reference in New Issue
Block a user