How to use validator for props value in typescript?
type Props = {
name: string
type?: string // how to use "validator" ?
modelValue: any
}
const props = defineProps<Props>()
How to make it work as in the following declaration:
defineProps({
type: {
type: String,
validator(value) {
return ...
}
}
})