enum AnimalType {
CAT,
DOG,
}
interface AnimalEnum {
[AnimalType.CAT]: {
name: 'cat',
weight: 6,
};
[AnimalType.DOG]: {
name: 'dog',
weight: 20
};
}
const animal: AnimalEnum[AnimalType] = {
name: 'cat',
weight: 6
}
版权属于:谁把年华错落成诗 所有,转载请注明出处!
本文链接:https://blog.pomears.com/archives/69.html
如果博客部分链接出现404,请留言或者联系博主修复。