uni.removeSavedFile(OBJECT
);
删除本地存储的文件。
1 平台
App | H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 字节跳动小程序 | QQ小程序 |
---|---|---|---|---|---|---|
√ | x | √ | √ | √ | √ | √ |
2 语法
语法:
2.1 OBJECT
参数
参数名 | 类型 | 必填 | 说明 | 平台差异 |
---|---|---|---|---|
filePath | String | 是 | 需要删除的文件路径 | |
success | Function | 否 | 接口调用成功的回调函数 | |
fail | Function | 否 | 接口调用失败的回调函数 | |
complete | Function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
3 示例
uni.getSavedFileList({
success: function (res) {
if (res.fileList.length > 0) {
uni.removeSavedFile({
filePath: res.fileList[0].filePath,
complete: function (res) {
console.log(res);
}
});
}
}
});
0 个评论
要回复文章请先登录或注册