type tabT = {
title: string;
id: number;
};
type tabT2 = {
color: string;
tab: Array<tabT>;
};
const props = withDefaults(defineProps<tabT2>(), {
color: "#fff",
tab: () => {
return [
{
title: "首页",
id: 1,
},
{
title: "招商合作",
id: 2,
},
];
},
});
2023-04-07 14:43:29 vue3+ts 定义definsProps的默认值
于 2023-04-07 14:43:29 首次发布