上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 494 下一页
摘要: // 内置工具类型 // 1. Partial<T>:将类型 T 的所有属性变为可选属性。 // 2. Required<T>:将类型 T 的所有可选属性变为必需属性。 // 3. Readonly<T>:将类型 T 的所有属性变为只读属性。 // 4. Record<K, T>:将类型 K 的所有 阅读全文
posted @ 2025-05-11 14:53 Zhentiw 阅读(30) 评论(0) 推荐(0)
摘要: 开发中的那些规范 为什么需要规范 现在开发一个应用基本上都是多人协作,一旦涉及到多人,必然不同的开发者的开发习惯、编码方式都是有所不同的,如果没有一个统一的规范,就会造成非常多的问题: 代码风格不一 目录杂乱无章 接口不统一(偏后端),例如: 修改用户定的接口为 /v1/users 修改密钥的接口: 阅读全文
posted @ 2025-05-08 13:42 Zhentiw 阅读(65) 评论(0) 推荐(0)
摘要: Sometime the element width is dynmiac, and you want to use the width in css, how to do that 1. Define css variable in css file, --wis the container's 阅读全文
posted @ 2025-05-06 14:17 Zhentiw 阅读(7) 评论(0) 推荐(0)
摘要: By default, git ignorecase for filename. It might happen that you change the filename from Modal.vueto modal.vue, then commit to git, in remote repo, 阅读全文
posted @ 2025-05-06 14:10 Zhentiw 阅读(12) 评论(0) 推荐(0)
摘要: type Watcher<T> = { on<K extends keyof T & string>( eventName: `${K}Changed`, callback: (oldValue: T[K], newValue: T[K]) => void ): void; }; declare f 阅读全文
posted @ 2025-05-06 14:06 Zhentiw 阅读(7) 评论(0) 推荐(0)
摘要: const get = /*#__PURE__*/ createGetter(); const readonlyGet = /*#__PURE__*/ createGetter(true); const shallowGet = /*#__PURE__*/ createGetter(false, t 阅读全文
posted @ 2025-04-08 00:55 Zhentiw 阅读(13) 评论(0) 推荐(0)
摘要: const obj = { a: 1, b: 2, c: { d: 3 } } console.log(obj.toString()) // [object Object] Using Symbol.toStringTag const obj = { a: 1, b: 2, c: { d: 3 }, 阅读全文
posted @ 2025-04-08 00:27 Zhentiw 阅读(15) 评论(0) 推荐(0)
摘要: Using T extends any ? {...} : never helps to see the type result Example: type DeepReadonly<T extends Record<string, any>> = T extends any ? { readonl 阅读全文
posted @ 2025-04-05 19:47 Zhentiw 阅读(14) 评论(0) 推荐(0)
摘要: 框架设计的权衡 框架设计里面到处体现了权衡的艺术。 在框架设计之初,我们的最初的构想往往是“既要....又要....”,但是往往现实是非常残酷的, 因此我们需要处处作出权衡。 框架的设计应该将其设计为命令式还是声明式 ? 框架需要设计成纯运行时还是纯编译时,还是设计为运行时 + 编译时 ? 这里只是 阅读全文
posted @ 2025-04-05 19:11 Zhentiw 阅读(20) 评论(0) 推荐(0)
摘要: 本文将带着大家使用 Node.js 快速制作一个 cli 工具,主要包含以下内容: 搭建 cli 整体框架 完善 cli 命令 搭建 cli 整体框架 首先,在桌面上新建一个 cli 工程目录 mycli,npm init -y 进行初始化,如下: cd desktop mkdir mycli cd 阅读全文
posted @ 2025-04-05 19:10 Zhentiw 阅读(106) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 494 下一页