0
- 我想你的代码在我的代码库是打字稿整合...
- 我得到了如下的错误类型的这种 [TS]参数” {类型:string []; }'不能分配给'BlobPropertyBag'类型的参数。 “类型”属性的类型不兼容。类型'string []'不可分配给'string'类型。 (property)type:string [] a t this line ----------------> var csv =“a,b,c \ n1,2,3 \ n”; let data = new Blob([csv],{type:mimeType});
- prviding code below。
- 正常js中的样本提琴不在打字稿中。
- 你能告诉我如何解决它
http://jsfiddle.net/jcqtawad/type script type'{type:string []; }“不是分配给参数类型的‘BlobPropertyBag’
let types = ["text/plain", "application/pdf"];
let downloads = health.map(function(version) {
let ext = version.mobileVersion.replace(/.*(?=\.\w+)/, "");
let mimeType = types.filter(function(type) {
return type.indexOf(ext) > -1
});
let data = new Blob([/* Blob data */], {
type: mimeType
});
return $("<a>", {
"class": "sportsDataPlayer",
download: ev.FileName + ext,
type: mimeType,
href: URL.createObjectURL(data),
html: ev.FileName
});
});