交叉类型
- 交叉类型演示
interface Person {
name: string;
say(): number;
}
interface Contact {
phone: string;
}
type PersonDetail = Person & Contact;
let obj: PersonDetail = {
name: "jack",
phone: "133....",
say() {
return 1;
},
};