会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Zina
不积跬步,无以至千里
博客园
首页
新随笔
联系
管理
订阅
上一页
1
2
3
4
5
6
7
8
···
58
下一页
2020年8月7日
TypeScript 访问器装饰器
摘要: 访问器譬如 private public protect /** * 访问器装饰器的参数跟方法装饰器的参数是一样的 * @param target prototype * @param key function name * @param descriptor 描述符 */ function vis
阅读全文
posted @ 2020-08-07 08:22 wzndkj
阅读(440)
评论(0)
推荐(0)
2020年8月6日
TypeScript 方法装饰器
摘要: /** * 装饰器永远是个方法,方法的装饰器,里面的三个参数是规定好的 * * @param target 普通方法 target 对应的是类的 prototype * 静态方法 target 对应的是类的构造函数 * * @param key 装饰方法的名字 * * @param descript
阅读全文
posted @ 2020-08-06 08:21 wzndkj
阅读(501)
评论(0)
推荐(0)
2020年8月3日
TypeScript 类的装饰器2
摘要: // 最外层是个函数,再返回一个新的函数 function testDecorator(flag: boolean) { if (flag) { return function (constructor: any) { constructor.prototype.getName = () => {
阅读全文
posted @ 2020-08-03 08:32 wzndkj
阅读(152)
评论(0)
推荐(0)
2020年7月30日
TypeScript 类的装饰器
摘要: // 类的装饰器:对类的一个修饰 /** * 装饰器本身是一个函数 * @param constructor * 类的装饰器接收的函数是类的构造函数 constructor * * testDecorator 的运行时机是类创建的时候立即执行 * 对类做修饰,不是对实例做修饰 */ function
阅读全文
posted @ 2020-07-30 08:45 wzndkj
阅读(894)
评论(0)
推荐(0)
2020年6月30日
TypeScript 泛型中 keyof 语法的使用
摘要: interface Person{ name: string; age: number; gender: string; } class Teacher{ constructor(private info: Person) { } // getInfo(key: string) { // retur
阅读全文
posted @ 2020-06-30 06:33 wzndkj
阅读(4633)
评论(0)
推荐(0)
2020年6月29日
TypeScript 模块代码的类型描述文件
摘要: 安装 jquery cnpm install jquery --save 不以 cdn 的方式引入,而是以模块化的方式引入 jquery index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta n
阅读全文
posted @ 2020-06-29 06:25 wzndkj
阅读(216)
评论(0)
推荐(0)
2020年6月28日
TypeScript 描述文件中的全局类型
摘要: index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <titl
阅读全文
posted @ 2020-06-28 06:24 wzndkj
阅读(2257)
评论(0)
推荐(0)
2020年6月25日
TypeScript 描述文件 (.d.td) 中的全局类型
摘要: index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <titl
阅读全文
posted @ 2020-06-25 07:27 wzndkj
阅读(992)
评论(0)
推荐(0)
TypeScript 使用Parcel打包TS代码
摘要: 初始化 package.json npm init -y 初始化 tsconfig.json tsc --init 安装 parcel cnpm install parcel@next -D tsconfig.json 找到配置 "outDir": "./dist", "rootDir": "./s
阅读全文
posted @ 2020-06-25 06:56 wzndkj
阅读(714)
评论(0)
推荐(0)
2020年6月23日
TypeScript import
摘要: ///<reference path = 'components.ts' /> namespace Home{ export class Page{ user: Components.User = { name: '111' } constructor() { new Components.Head
阅读全文
posted @ 2020-06-23 06:39 wzndkj
阅读(402)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
···
58
下一页