In my exploration of Vuetify and other sources, I discovered that it is possible to incorporate type checking for props within the template tag.
Let's consider a simple button component:
<template>
<div>
<button>{{ label }}</button>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
props: {
label: { type: String as () => string, default: '' },
},
});
</script>
Now, in the parent component:
<button-component :label="true" />
Even though Vue provides a compiler warning indicating that the parameter is incorrect, is it feasible to check for errors while typing out the code? If not, why specify TypeScript types in the props?