vue3 、typescript环境, props自定义类型propType
//子组件的props类型是复杂的类型的时候,可以用propType进行强制类型转换
//eg 复杂函数,对象数组,对象的类型检查
props: {
callback: {
type: Function as PropType<() => void>,
},
tableHead: {
type: Array as PropType<getTableHeadRes[]>,
default:
() => [],
},
person: {
type: Object as PropType<Person>,
required:true,
},
}
标签:typescript,自定义,propType,vue3,PropType,type,props
From: https://www.cnblogs.com/littleH/p/17130421.html