【发布时间】:2021-05-27 16:42:04
【问题描述】:
我知道 typescript 类型不是运行时变量。但是有什么解决方法如何打印类型名称和变量?
type TestDto = {
active: number;
user_name: string;
};
console.log(TestDto);
投掷 only refers to a type, but is being used as a value here.
我想根据 TS 类型创建对象属性。我想创建 JS 对象,其属性为 active 和 user_name 并带有一些默认值
【问题讨论】:
标签: typescript