我现在想自定义一个属性,支持多种类型
我的代码:
defineProps({
childrens: {
type: [Array as PropType<amiaRoute[]> , Object as PropType<amiaRoute>],
default: () => {
return [];
}
}
})
但是一直报错:
我现在想自定义一个属性,支持多种类型
我的代码:
defineProps({
childrens: {
type: [Array as PropType<amiaRoute[]> , Object as PropType<amiaRoute>],
default: () => {
return [];
}
}
})
但是一直报错:
defineProps({
childrens: {
type: [Array , Object] as PropType<amiaRoute[]|amiaRoute>,
default: []
}
})
4 回答4.6k 阅读✓ 已解决
4 回答2.1k 阅读✓ 已解决
4 回答2.2k 阅读✓ 已解决
3 回答5k 阅读
2 回答2.6k 阅读✓ 已解决
1 回答3.1k 阅读✓ 已解决
2 回答1.5k 阅读✓ 已解决