createObjectUrl不存在

时间:2019-03-20 12:09:37

标签: angular

我想在项目中使用URL.createObjectURL,但是在编译项目时得到: 错误TS2339:类型“ URL”上不存在属性“ createObjectURL”。 WebStorm在URL中也没有看到此方法,我必须做类似URL.prototype.createObjectURL的操作,但是无论如何我仍然会遇到该错误。

示例我想如何使用它(或应该工作)

private createUrl(image: Blob) {
return URL.createObjectURL(image) }

0 个答案:

没有答案