(1)传统写法:

const props = defineProps({
    msg: {
        type: String,
        default: '',
    },
    data: {
        type: Object as PropType<dataBody>
        default: () => {}
    }
});

(2)接口泛型写法:

interface Props{
    msg: string;
    data: dataBody;
};

const props = defineProps<Props>();
Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐