ts声明类型后无法使用变量 小空空的代码生活 2021-07-23 125 阅读1分钟 ts声明变量为字符串类型后,如果无法给变量赋值,可以使用模板字符串 eg: name:string = this.name; 可以这么写 name:string = ${this.name}