Function openFileSelect

  • 在浏览器中打开文件选择框

    Parameters

    • Optionaloptions: {
          accept?: string;
          multiple?: boolean;
          resultType?: "blob" | "base64";
      }

      打开配置

      • Optionalaccept?: string
      • Optionalmultiple?: boolean
      • OptionalresultType?: "blob" | "base64"

    Returns Promise<any>

    openFileSelect({ multiple: true }).then(fileList => console.log(fileList));
    openFileSelect({ multiple: true, accept: 'image/*', resultType: 'blob' }).then(fileBlobList => console.log(fileBlobList));
    openFileSelect({ multiple: true, accept: '.txt', resultType: 'base64' }).then(fileDataUrlList => console.log(fileDataUrlList));