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'
})
defineProps fügt dem vue3-Typescript-Projekt komplexe Typen hinzu und gibt einen Standardwert an
おすすめ
転載: blog.csdn.net/weixin_35958891/article/details/131192809
おすすめ
ランキング