ts高级用法 a year ago
extract type from something else
const project = {
title:"scott",
specification: {
areaSize: 100,
rooms:3
}
}
type Specification = typeof project["specification"]
- 上一篇: react:自定义hook
const project = {
title:"scott",
specification: {
areaSize: 100,
rooms:3
}
}
type Specification = typeof project["specification"]