【发布时间】:2019-02-03 10:48:55
【问题描述】:
我正在尝试做这样的事情:
function attachUUID<T>(o:T) {
o[Symbol('id')]=v1();
}
T 泛型类型是一个类定义或一些定义的 Typescript type。 VSCode 错误是:
[ts] Element implicitly has an 'any' type because type '{}' has no index signature
【问题讨论】:
标签: javascript typescript metaprogramming symbols