//定义接收props的ts接口
interface Props {
userName: string;
sontable: object[];
suceess: {
num: number;
meanScore: string;
washTotTime: string;
jobNumber: number;
};
}
//定义props接收props传来的值
const props = withDefaults(defineProps<Props>(), {
userName: "默认",
sontable: () => [],
success: () => {},
});
//子传父事件
const emit = defineEmits<{
(e: "info", val: any): void;
}>();
**注意** defineProps接收引用类型须是包装一个函数,return出去