Skip to content

选择文件系统弹窗 v1.8.0 ​

方法名 ​

selectFiles

用法 ​

用法示例 ​

js
module.selectFiles({
  //文件类型
  type: "*/*"
}, res => {
  this.writeLog(JSON.stringify(res))
});

参数说明 ​

参数名参数类型是否必填默认值参数描述
typeString否*/*需要展示的文件格式

回调 ​

回调示例 ​

json
{
  "data": {
    "uriString": "content://com.android.providers.media.documents/document/document%3A110561",
    "path": "/storage/emulated/0/test.txt"
  },
  "message": "",
  "code": 0
}

回调说明 ​

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
data.uriStringStringUri的原生数据
data.pathString选择的文件路径
codeInteger返回类型,0.成功,其他:失败