实践经验
- 添加注释,会给更智能的提示
export interface ITaskGroupDetail { /** 1 文字排版 2 图文排版 */ type: 1 | 2;}
- 使用 interface 某个成员的类型
interface ITaskGroupDetail { type: 1 | 2;}interface ITest { type: type: ITaskGroupDetail['type']}
export interface ITaskGroupDetail { /** 1 文字排版 2 图文排版 */ type: 1 | 2;}
interface ITaskGroupDetail { type: 1 | 2;}interface ITest { type: type: ITaskGroupDetail['type']}