首页 > 其他分享 >ts报错解决-//@ts-ignore

ts报错解决-//@ts-ignore

时间:2022-09-28 16:13:49浏览次数:75  
标签:错误 代码 ts ignore 报错 type

项目中最近切换了TypeScript,运行时没有问题的,但是打包的时候会报很多的错,最后我们是在报错的文件上方加上了 '// @ts-ignore'隐藏了ts文件的报错,建议我们在使用的时候在这句代码给定相应的注释,解释一下为什么使用。

if (this.type) {
    // @ts-ignore:无法被执行的代码的错误
    console.log(this.type);
}
 //@ts-ignore 无法被执行的代码错误
 let asset = deserialize(effect, { priority: 0, responseType: "json" }) as any;

 

标签:错误,代码,ts,ignore,报错,type
From: https://www.cnblogs.com/jiaxin2015/p/16738438.html

相关文章