修正选择文件API错误

pull/551/MERGE
ChenX 5 years ago
parent 1ffb7a32bd
commit 846f99b7bf

@ -358,13 +358,13 @@ export class FileSystem
*/ */
static ChooseFile({ filter, multiple = false, callback }: { filter?: string; multiple?: boolean; callback: (filelist: FileList) => void; }) static ChooseFile({ filter, multiple = false, callback }: { filter?: string; multiple?: boolean; callback: (filelist: FileList) => void; })
{ {
if (!this.chooserInput) if (this.chooserInput)
{ this.chooserInput.remove();
this.chooserInput = document.createElement("input"); this.chooserInput = document.createElement("input");
this.chooserInput.type = "file"; this.chooserInput.type = "file";
this.chooserInput.style.display = "none"; this.chooserInput.style.display = "none";
document.body.appendChild(this.chooserInput); document.body.appendChild(this.chooserInput);
}
this.chooserInput.accept = filter; this.chooserInput.accept = filter;
this.chooserInput.onchange = () => this.chooserInput.onchange = () =>

Loading…
Cancel
Save