上一页 1 ··· 4 5 6 7 8 9 10 11 下一页
摘要: 1:下载运行Redis Windows https://github.com/MSOpenTech/redis/releases 运行: C:\Program Files\Redis\redis-server.exe redis.windows.conf 运行成功后,可以在Services中看到Re 阅读全文
posted @ 2021-04-18 22:38 老胡Andy 阅读(1198) 评论(0) 推荐(0) 编辑
摘要: 既然使用了Typescript,自然会想到oop的那些设计模式。 传统的GOF设计模式,这里就不提及了,相关资料太多。 这里想讲述一下如何实现AOP、IOC两种设计模式。 一)AOP(面向切面编程) aop在.net、java等平台上都有成熟的实现。举例说明其现实需求:假设有一个业务方法doSome 阅读全文
posted @ 2021-04-17 14:07 老胡Andy 阅读(886) 评论(0) 推荐(0) 编辑
摘要: 新建项目文件夹: mkdir react-setup cd react-setup mkdir public src touch public/index.html touch src/app.js 配置及依赖: npm init -y npm install webpack webpack-cli 阅读全文
posted @ 2021-03-26 09:36 老胡Andy 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 一) 安装基础依赖 Npm init -y npm install webpack webpack-cli --save-dev npm install typescript ts-loader --save-dev npm install jest @types/jest ts-jest --sa 阅读全文
posted @ 2021-03-26 09:21 老胡Andy 阅读(87) 评论(0) 推荐(0) 编辑
摘要: Webpack.config.js的entry属性定义了打包文件的入口点。 参考:https://webpack.docschina.org/configuration/entry-context/#entry 但在实践中开发人员可能会发现其不便之处:对于multi-page app,需要为每个js 阅读全文
posted @ 2021-03-26 09:20 老胡Andy 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 参考:https://webpack.js.org/guides/development/ 1:Webpack.config.js 加入 mode: 'development', 2: 使用source map devtool: 'inline-source-map' 3: 使用webpack-de 阅读全文
posted @ 2021-03-14 21:07 老胡Andy 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 一:基础设置 参考:https://webpack.js.org/guides/getting-started/ npm init -y npm install webpack webpack-cli --save-dev 代码: webpack.config.js const path = req 阅读全文
posted @ 2021-03-14 10:42 老胡Andy 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 起因:想要重构原有的基于JQuery项目, 该项目中原来的开发人员扩展了一些JQuery方法,导致@typescript/jquery库中没有这些方法的定义。 解决方法:使用TypeScript的类型申明扩展 代码如下: export interface JQueryStatic { } expor 阅读全文
posted @ 2021-03-11 22:43 老胡Andy 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 为什么要使用eslint、airbnb配置项? 因为: ESLint + Airbnb = Standard JS 步骤如下: 1:create-react-app cra-eslint-airbnb-sample --template typescript 2:cd cra-eslint-airb 阅读全文
posted @ 2021-01-17 16:29 老胡Andy 阅读(948) 评论(0) 推荐(0) 编辑
摘要: npx create-next-app sample01 npm install --save-dev typescript npm install --save-dev @types/react @types/react-dom @types/node //该命令会在项目根目录下新建tsconfi 阅读全文
posted @ 2021-01-17 11:02 老胡Andy 阅读(420) 评论(0) 推荐(1) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 下一页