
ts
琉璃枫桦
不要把杂七杂八的需求都给我了,真干不动了。 干的太多了
展开
-
TS 内置工具
TS 内置工具1、Record -> 生产一个属性为K,类型为T的类型集合。type React<K entends keyof any, T> = {[P in K]: T;}用法type Foo = Record<‘a’, string> // 相当于 type Foo = { a: string }type Bar = {b: string}type Baz = Record< keyof Foo | keyof Bar, number >原创 2020-10-29 13:43:43 · 2382 阅读 · 0 评论 -
关于 dva+ts的配置(别名 + 二级路由 + 状态管理)
dva+ts 的路由配置(二级路由)1、 dva+ts 基础安装dvanpm i dva-cli -gdva new . // 或 dva new 文件名tsnpm i -g typescriptnpm i -S @types/react @types/react-dom ts-loader ts-lint配置tsconfig.json{ "compilerOptions": { "strictNullChecks": true, "原创 2020-08-03 21:43:29 · 2611 阅读 · 0 评论