2018年9月3日

摘要: 原文:https://www.tslang.cn/docs/handbook/classes.html 派生类包含了一个构造函数,它 必须调用 super(),它会执行基类的构造函数。 而且,在构造函数里访问 this的属性之前,我们 一定要调用 super()。 这个是TypeScript强制执行 阅读全文
posted @ 2018-09-03 14:02 温温婉婉 阅读(149) 评论(0) 推荐(0) 编辑
 
摘要: 属性接口 interface SquareConfig { color?: string; width?: number; } function createSquare(config: SquareConfig): { color: string; area: number } { // ... 阅读全文
posted @ 2018-09-03 13:52 温温婉婉 阅读(146) 评论(0) 推荐(0) 编辑