1.字符串数组
defineProps({
acb: Array as () => string[]
})
2.简单对象
defineProps({
company: Object as () => ({name: string, domain: string})
})
3.自定义类型
type Compay={ name:string,domain:string }
defineProps({ compmay: {
type:Object as ()=> Compay
} })
-------------------------------------------------------------
interface Person {
name:string
}
defineProps({
person:{
type:Object as ()=> Person
}
})
4.函数
import { PropType } from 'vue'
type func=(args?: string[])=> string
defineProps({
func:{
type: Function as ()=> PropType<func>
}
})