vue3 typescript项目中 defineProps添加复杂类型,并给定默认值
·
interface Props {
options: {
label: string
value: string | number | boolean
}[]
color: string
}
const props = withDefaults(defineProps<Props>(), {
options: () => [
{ label: '项1', value: '项1' },
{ label: '项2', value: '项2' }
],
color: 'red'
})
博主开发了一个浏览器aweb123.com
更多推荐


所有评论(0)