随笔分类 - typescript
typecript: class 类
摘要:原文:https://www.tslang.cn/docs/handbook/classes.html 派生类包含了一个构造函数,它 必须调用 super(),它会执行基类的构造函数。 而且,在构造函数里访问 this的属性之前,我们 一定要调用 super()。 这个是TypeScript强制执行
阅读全文
typescript 接口
摘要:属性接口 interface SquareConfig { color?: string; width?: number; } function createSquare(config: SquareConfig): { color: string; area: number } { // ...
阅读全文
浙公网安备 33010602011771号