我现在想自定义一个属性,支持多种类型
我的代码:
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: []
}
})
9 回答1.7k 阅读✓ 已解决
6 回答1.6k 阅读
3 回答1.4k 阅读✓ 已解决
4 回答1.3k 阅读✓ 已解决
3 回答1.1k 阅读
2 回答1.2k 阅读✓ 已解决
3 回答1.4k 阅读✓ 已解决