Skip to content

Commit

Permalink
fix: use correct types
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Oct 12, 2023
1 parent 3d08ad9 commit 0e6f13d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
21 changes: 7 additions & 14 deletions src/.vuepress/theme/client/components/Fragment.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
<template>
<component
<Component
:is="component"
v-if="component">
<slot />
</component>
</Component>
<slot v-else />
</template>

<script lang="ts">
import {type PropType, defineComponent} from 'vue';
import {type ComponentOrHtmlElement} from '../../../../../types/types';
<script lang="ts" setup>
import {type Component} from 'vue';
export default defineComponent({
name: 'Fragment',
props: {
component: {
type: [String, Object] as PropType<ComponentOrHtmlElement>,
default: null,
},
},
});
defineProps<{
component?: string | Component;
}>();
</script>
2 changes: 0 additions & 2 deletions types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@ declare interface SidebarItemV1 {

declare type SidebarV1ConfigArray = (SidebarItemV1 | string)[];

export type ComponentOrHtmlElement = string | Component | undefined;

declare const __VUEPRESS_DEV__: boolean;
declare const __VUEPRESS_SSR__: boolean;

0 comments on commit 0e6f13d

Please sign in to comment.