
typescript
typescript
LetsStudy
The growth of age will not be a hindrance to study.
展开
-
1.4 装饰器的简单示例
装饰器原创 2022-11-09 15:51:57 · 121 阅读 · 0 评论 -
1.3 typescript的引入与导出
一、目前typescript是可以通过三斜线指令和import进行引入的 三斜线指令是用来标明文件之间的依赖关系,不能当作import使用,当使用export导出命名空间时,在别的模块要使用它,必须使用import引入,下面代码可以使用ts-node App.ts直接运行 示例 //Test.ts import {Test1} from "./test"; export namespace Test{ export class C implements Test1.A{ h原创 2021-07-29 16:13:40 · 1937 阅读 · 0 评论 -
1.2 typescript中的class
一、class java 1、抽象类中可以有抽象的方法,不需要实现 2、抽象类中也可以有非抽象的方法,需要具体实现 3、抽象类中可以有常量及变量 4、抽象类之间可以相互继承 5、抽象类的成员可以被private、public、protected所修饰 6、抽象中可以有静态方法 7、抽象类可以实现interface,即可以重写interface中的方法,也可以不实现,由抽象类的子类去实现 8、抽象类和interface一样,不可以实例化 //interface A public inte原创 2021-07-28 17:03:04 · 239 阅读 · 0 评论 -
1.1 typescript中的interface
一、java中的interface java 1、interface中的非静态、非default方法都是抽象方法,只有定义,没有实现 2、interface中的变量都是常量,被final static修饰 3、interface中可以有default方法,可以有实现,可以被interface的子类引用调用 4、interface中可以有静态方法及实现,可以通过类名直接调用 5、方法及成员都是被public修饰的 6、interface之间才能使用extends,class和interface之原创 2021-07-28 16:01:30 · 1713 阅读 · 0 评论 -
1.2 nodejs自动化环境变量配置
一、在windows的系统变量里添加 变量名:NODE_ENV 变量值: development 二、linux下面添加环境变量 export NODE_ENV=development 三、在代码中可以通过env来判断使用的url const url = process.env.NODE_ENV=='development'?'https://www.development.com' :process.env.NODE_ENV=="test"?'https://www.tes.原创 2021-04-02 20:45:46 · 254 阅读 · 0 评论