随笔分类 - Typescript
摘要:一个简单event bus的实现 发布订阅者模式 type emitKey = number | string | symbol; type func = (...args: any) => void; interface BusInterface { emit: (key: emitKey, ..
阅读全文
摘要:问题描述 学习Vue3 Ref 相关 API 的时候,遇到了 customRef 这个 API,它可以让我们自定义 ref 的更新的过程 但是使用 customRef 有一个问题就是,如果你传入的是初始值,那么一切正常,如果你传入的是一个对象,那 set 函数将会不起作用 customRef 简单使
阅读全文
摘要:example e.g. 1 e.g. 2 e.g. 3 解释 在 typescript 中 定义一个 class class 的 constructor 里面的语句在转义成 JavaScript 之后会被放在最后执行 在其他区域声明的变量会在其之前执行 但是如果是在 constructor 参数里
阅读全文

浙公网安备 33010602011771号