上一页 1 2 3 4 5 6 7 8 ··· 58 下一页
摘要: 访问器譬如 private public protect /** * 访问器装饰器的参数跟方法装饰器的参数是一样的 * @param target prototype * @param key function name * @param descriptor 描述符 */ function vis 阅读全文
posted @ 2020-08-07 08:22 wzndkj 阅读(427) 评论(0) 推荐(0) 编辑
摘要: /** * 装饰器永远是个方法,方法的装饰器,里面的三个参数是规定好的 * * @param target 普通方法 target 对应的是类的 prototype * 静态方法 target 对应的是类的构造函数 * * @param key 装饰方法的名字 * * @param descript 阅读全文
posted @ 2020-08-06 08:21 wzndkj 阅读(493) 评论(0) 推荐(0) 编辑
摘要: // 最外层是个函数,再返回一个新的函数 function testDecorator(flag: boolean) { if (flag) { return function (constructor: any) { constructor.prototype.getName = () => { 阅读全文
posted @ 2020-08-03 08:32 wzndkj 阅读(146) 评论(0) 推荐(0) 编辑
摘要: // 类的装饰器:对类的一个修饰 /** * 装饰器本身是一个函数 * @param constructor * 类的装饰器接收的函数是类的构造函数 constructor * * testDecorator 的运行时机是类创建的时候立即执行 * 对类做修饰,不是对实例做修饰 */ function 阅读全文
posted @ 2020-07-30 08:45 wzndkj 阅读(883) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(4611) 评论(0) 推荐(0) 编辑
摘要: 安装 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 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(2234) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(969) 评论(0) 推荐(0) 编辑
摘要: 初始化 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 阅读(699) 评论(0) 推荐(0) 编辑
摘要: ///<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 阅读(393) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 58 下一页