0👍
You need to define the type for the props
parameter. E.g.:
interface Props {
icon: {
icon: PropType<IconType>;
required: boolean;
}
}
Then you can use it in the setup code:
setup (props: Props) {
Further explanation: The props object that you have written directly below export default defineComponent({
is used by Vue to define valid input properties for the component, however you need the above for TypeScript to infer their types.
- [Vuejs]-How can I get the next 6 days in a v-for loop in Vue3?
- [Vuejs]-How can I add border radius to the first and last elements with a specific class
Source:stackexchange.com