Skip to content

Commit

Permalink
fix: vue-tsc error
Browse files Browse the repository at this point in the history
  • Loading branch information
zernonia committed Oct 20, 2023
1 parent 4c6a18f commit 1e382f0
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/radix-vue/src/Collapsible/CollapsibleRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const emit = defineEmits<CollapsibleRootEmits>()
const open = useVModel(props, 'open', emit, {
defaultValue: props.defaultOpen,
passive: (props.open === undefined) as false,
})
}) as Ref<boolean>
const disabled = useVModel(props, 'disabled')
Expand Down
2 changes: 1 addition & 1 deletion packages/radix-vue/src/Combobox/ComboboxRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const modelValue = useVModel(props, 'modelValue', emit, {
const open = useVModel(props, 'open', emit, {
defaultValue: props.defaultOpen,
passive: (props.open === undefined) as false,
})
}) as Ref<boolean>
async function onOpenChange(val: boolean) {
open.value = val
Expand Down
2 changes: 1 addition & 1 deletion packages/radix-vue/src/Dialog/DialogRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const emit = defineEmits<DialogRootEmits>()
const open = useVModel(props, 'open', emit, {
defaultValue: props.defaultOpen,
passive: (props.open === undefined) as false,
})
}) as Ref<boolean>
const triggerElement = ref<HTMLElement>()
const contentElement = ref<HTMLElement>()
Expand Down
2 changes: 1 addition & 1 deletion packages/radix-vue/src/DropdownMenu/DropdownMenuRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const emit = defineEmits<DropdownMenuRootEmits>()
const open = useVModel(props, 'open', emit, {
defaultValue: props.defaultOpen,
passive: (props.open === undefined) as false,
})
}) as Ref<boolean>
const triggerElement = ref<HTMLElement>()
Expand Down
2 changes: 1 addition & 1 deletion packages/radix-vue/src/HoverCard/HoverCardRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const { openDelay, closeDelay } = toRefs(props)
const open = useVModel(props, 'open', emit, {
defaultValue: props.defaultOpen,
passive: (props.open === undefined) as false,
})
}) as Ref<boolean>
const openTimerRef = ref(0)
const closeTimerRef = ref(0)
Expand Down
2 changes: 1 addition & 1 deletion packages/radix-vue/src/Menu/MenuSub.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const emits = defineEmits<{
const open = useVModel(props, 'open', emits, {
defaultValue: false,
passive: (props.open === undefined) as false,
})
}) as Ref<boolean>
const parentMenuContext = injectMenuContext()
const trigger = ref<HTMLElement>()
Expand Down
2 changes: 1 addition & 1 deletion packages/radix-vue/src/Popover/PopoverRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const { modal } = toRefs(props)
const open = useVModel(props, 'open', emit, {
defaultValue: props.defaultOpen,
passive: (props.open === undefined) as false,
})
}) as Ref<boolean>
const triggerElement = ref<HTMLElement>()
const hasCustomAnchor = ref(false)
Expand Down
5 changes: 4 additions & 1 deletion packages/radix-vue/src/ScrollArea/ScrollAreaScrollbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import { createContext } from '@/shared'
export interface ScrollAreaScrollbarProps extends PrimitiveProps {
orientation?: 'vertical' | 'horizontal'
/**
* Used to force mounting when more control is needed. Useful when
* controlling animation with Vue animation libraries.
*/
forceMount?: boolean
}
Expand Down Expand Up @@ -39,7 +43,6 @@ import { type AsTag, type PrimitiveProps } from '@/Primitive'
const props = withDefaults(defineProps<ScrollAreaScrollbarProps>(), {
orientation: 'vertical',
forceMount: undefined,
as: 'div',
})
Expand Down
2 changes: 1 addition & 1 deletion packages/radix-vue/src/Select/SelectRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const modelValue = useVModel(props, 'modelValue', emits, {
const open = useVModel(props, 'open', emits, {
defaultValue: props.defaultOpen,
passive: (props.open === undefined) as false,
})
}) as Ref<boolean>
const triggerElement = ref<HTMLElement>()
const valueElement = ref<HTMLElement>()
Expand Down
2 changes: 1 addition & 1 deletion packages/radix-vue/src/Switch/SwitchRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const { disabled } = toRefs(props)
const checked = useVModel(props, 'checked', emit, {
defaultValue: props.defaultChecked,
passive: (props.checked === undefined) as false,
})
}) as Ref<boolean>
function toggleCheck() {
if (disabled.value)
Expand Down
3 changes: 2 additions & 1 deletion packages/radix-vue/src/Toast/ToastRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { Presence } from '@/Presence'
import ToastRootImpl, { type ToastRootImplEmits, type ToastRootImplProps } from './ToastRootImpl.vue'
import { useVModel } from '@vueuse/core'
import type { Ref } from 'vue'
const props = withDefaults(defineProps<ToastRootProps>(), {
type: 'foreground',
Expand All @@ -26,7 +27,7 @@ export type ToastRootEmits = ToastRootImplEmits & {
const open = useVModel(props, 'open', emits, {
defaultValue: props.defaultOpen,
passive: (props.open === undefined) as false,
})
}) as Ref<boolean>
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion packages/radix-vue/src/Tooltip/TooltipRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const delayDuration = computed(() => props.delayDuration ?? providerContext.dela
const open = useVModel(props, 'open', emit, {
defaultValue: props.defaultOpen,
passive: (props.open === undefined) as false,
})
}) as Ref<boolean>
watch(open, (isOpen) => {
if (!providerContext.onClose)
Expand Down

0 comments on commit 1e382f0

Please sign in to comment.