说明
在 TypeSctipr
里面定义嵌套类型,和定义它的外层类型是一样的
interface product {
title: string
price: number
categroy: {
name: string
}
}
interface product {
title: string
price: number
categroy: Categroy
}
interface Categroy {
name: string
}
let product = {
title: '纯棉秋裤',
price: 200,
categroy: {
name: '裤子'
}
}