随笔分类 -  TypeScritp学习笔记

typescript的一些笔记
摘要:tsconfig.json 的作⽤ ⽤于标识 TypeScript 项⽬的根路径; ⽤于配置 TypeScript 编译器; ⽤于指定编译的⽂件。 tsconfig.json 重要字段 files - 设置要编译的⽂件的名称; include - 设置需要进⾏编译的⽂件,⽀持路径模式匹配; excl 阅读全文
posted @ 2021-09-11 18:35 wl夏白 阅读(1120) 评论(0) 推荐(0)
摘要:接口 只读属性 实现接口后,值可以获取到,但是无法修改 interface Demo1{ name:string, age:number }; let va1:Demo1={name:"ming",age:18}; console.log(va1.name);//return ming va1.na 阅读全文
posted @ 2021-09-01 23:06 wl夏白 阅读(384) 评论(0) 推荐(0)
摘要://数组解构 console.log(' 数组解构 '); let five_array = [0, 1, 2, 3, 4]; let [x, y, z] = five_array; console.log(z);//return 2 //对象解构 console.log(' 对象解构 '); // 阅读全文
posted @ 2021-08-31 23:36 wl夏白 阅读(87) 评论(0) 推荐(0)
摘要://默认参数 console.log(' 默认参数 '); function demo1(name:string = "默认参数"): void { console.log(name); }; demo1();//return 默认参数 demo1("传入参数");//return 传入参数 // 阅读全文
posted @ 2021-08-31 22:55 wl夏白 阅读(68) 评论(0) 推荐(0)