我现在想自定义一个属性,支持多种类型
我的代码:
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: []
}
})
5 回答4.9k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答4.8k 阅读✓ 已解决
4 回答4.4k 阅读✓ 已解决
4 回答1.9k 阅读✓ 已解决
2 回答2.6k 阅读✓ 已解决
2 回答2.6k 阅读✓ 已解决