
typescript
空谷足音 -จุ
活出自己的世界!(微信18710307060)
展开
-
TypeScript-1.基础类型
// -----------------基础数据类型--------------------// 1.布尔值let isSucessed: Boolean = falselet isFailued: boolean = trueconsole.log(isSucessed+'---------布尔---------'+ isFailued)// 2.数字let maxSiz...原创 2019-05-15 18:41:08 · 176 阅读 · 0 评论 -
TypeScript-3.接口(interface)
1.接口(1) ? ----- 可选属性(2) readonly ----- 只读属性(只能在对象刚刚创建的时候修改其值)interface Config { width: number, height: number, color? : string, readonly name: string}let config: Config = {...原创 2019-05-21 11:29:09 · 393 阅读 · 0 评论 -
TypeScript-2.类(class)
1.认识类(1) public: 类的外部和内部、继承类均可访问(2) protected: 类的内部、继承类均可访问(3) private: 类内部可访问(一般get set提供外部访问)class Animal { name: string; // 默认public private _age: number; ...原创 2019-05-16 14:02:26 · 232 阅读 · 0 评论