感觉装饰器参数 target: type of User 等价于 target : "function" , 这能行吗?
来源:6-9 装饰器的执行顺序

慕后端5509432
2020-03-04
为啥这么说?
class User {
name = 0;
}
const res1 = typeof User;
const res2 = typeof res1;
console.log(res1); //function
console.log(res2); //string 也就是说 re1 === "function"
所以, target : “function” 这得怎么理解啊?
写回答
1回答
-
Dell
2020-03-07
类的底层,你就可以理解为一个function,这块新版的ts做了改动,我看下哈,新版本中你可以改成一个NewableFunction
122022-02-06
相似问题