I'm trying to use a dynamic component but it always has a type of any; How do I infer a type? The tag is passed as a prop to the component.
<script lang="ts" setup>
import { toRefs } from "vue";
const props = withDefaults(defineProps<{ as?: string }>(), {
as: "button",
});
const { as } = toRefs(props);
</script>
<template>
<component :is="as">
<slot>Button</slot>
</component>
</template>