
Typescript
Typescript相关
前端二狗子
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【node】移动目标路径下所有文件的实现
1.原生import fs from 'fs';import path from 'path';function copyFile(srcPath: string, tarPath, cb?: Function) { if (!fs.existsSync(path.dirname(tarPath))) fs.mkdir(path.dirname(tarPath), (err) => { if (err) cb && cb(err); });原创 2020-10-05 03:10:23 · 667 阅读 · 0 评论 -
【Typescript】【tsconfig】常用配置
最基础的配置。设置这些就能运行了。{ "compileOptions":{ "outOutDir":"dist", //编译后的目录 }, "include": ["src/**/*"] //包括ts的目录}常用{ "compilerOptions": { "module": "commonjs", //规定js模块化规范 "esModuleInterop": true, //兼容库的引用方式 "outDir": "di原创 2020-10-04 23:39:56 · 531 阅读 · 0 评论 -
【Typescript】跟tsconfig设置相关的报错
1.esModuleInteropimport express from ‘express’; 报错内容:此模块是使用 "export =" 声明的,在使用 "esModuleInterop" 标志时只能与默认导入一起使用。//解决方案:compilerOptions.esModuleInterop=true{ "compilerOptions": { "esModuleInterop": true }}原因:很多库没有默认输出,普通的方法为:import * as原创 2020-10-04 23:29:03 · 2259 阅读 · 0 评论 -
【Typescript】【Node】express + Typescript 基础框架搭建
相关资料node http://nodejs.cn/express https://www.expressjs.com.cn/ts https://www.tslang.cn/docs/home.html基本结构文件夹结构server dist //ts编译后文件夹 src //主要区域 models public //静态文件 routers //路由方法 a原创 2020-10-04 22:41:34 · 666 阅读 · 0 评论 -
【Typescript】【eslint】安装,配置,报错的记录
相关文档资料rules 设置https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/docs/rules报错no-this-alias.eslintrc.jsrules新增 '@typescript-eslint/no-this-alias': [ 'error', { allowDestructuring: true, //原创 2020-10-04 17:34:20 · 1786 阅读 · 0 评论 -
【Typescript】记录用TS重构Todolist的过程
有人说:用过ts的人的反应,只有真香和真tm香Gitgit clone https://github.com/DrBallon/TodoList.git --branch vue搭建框架因为暂时不擅长各种插件和配置,所以基础框架用vue-cli一梭子搞定vue-cli 版本 4vue create todolist-0.22//1.Please pick a preset: Manually select features选择"Manually select features" 手动选择..原创 2020-09-30 12:02:11 · 667 阅读 · 0 评论