Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid referring to complex types in props #123

Merged
merged 2 commits into from
Dec 17, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/runtime/components/overlays/ContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</template>

<script setup lang="ts">
import type { PropType } from 'vue'
import type { Ref } from 'vue'
import { computed, toRef } from 'vue'
import { defu } from 'defu'
import type { VirtualElement } from '@popperjs/core'
Expand All @@ -23,7 +23,7 @@ const props = defineProps({
default: false
},
virtualElement: {
type: Object as PropType<VirtualElement>,
type: Object,
required: true
},
wrapperClass: {
Expand All @@ -47,7 +47,7 @@ const props = defineProps({
default: () => $ui.contextMenu.transition
},
popperOptions: {
type: Object as PropType<PopperOptions>,
type: Object,
Copy link
Member

@benjamincanac benjamincanac Dec 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the PopperOptions type here? It's also defined in Dropdown, SelectCustom, Popover and Tooltip. Should we remove them all?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's a non-issue. Reverted

default: () => ({})
}
})
Expand All @@ -63,7 +63,7 @@ const isOpen = computed({
}
})

const virtualElement = toRef(props, 'virtualElement')
const virtualElement = toRef(props, 'virtualElement') as Ref<VirtualElement>

const popperOptions = computed<PopperOptions>(() => defu({}, props.popperOptions, $ui.contextMenu.popperOptions))

Expand Down