更新记录
1.0.4(2024-11-03)
新增鸿蒙插件版本
1.0.3(2024-05-29)
优化安卓插件目标路径规则。
1.0.2(2024-04-11)
修复安卓编译警告信息处理。
查看更多平台兼容性
Vue2 | Vue3 |
---|---|
√ | √ |
App | 快应用 | 微信小程序 | 支付宝小程序 | 百度小程序 | 字节小程序 | QQ小程序 |
---|---|---|---|---|---|---|
HBuilderX 3.6.8,Android:4.4,iOS:9,HarmonyNext:不确定 | × | × | × | × | × | × |
钉钉小程序 | 快手小程序 | 飞书小程序 | 京东小程序 |
---|---|---|---|
× | × | × | × |
H5-Safari | Android Browser | 微信浏览器(Android) | QQ浏览器(Android) | Chrome | IE | Edge | Firefox | PC-Safari |
---|---|---|---|---|---|---|---|---|
× | × | × | × | × | × | × | × | × |
概述
XF-fileSystemUTS对文件操作的接口,通过此插件可对文件或文件夹进行创建、删除、移动、复制等相关操作。
插件接口
createDir
创建目录
uni-app项目中(nvue)调用示例:
import { createDir } from "@/uni_modules/XF-fileSystemUTS"
createDir({
path: "",
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { createDir } from "@/uni_modules/XF-fileSystemUTS";
import { SystemOptions } from "@/uni_modules/XF-fileSystemUTS/utssdk/interface.uts";
let options = {
path: "",
complete: (res : any) => {
console.log(res)
}
} as SystemOptions;
createDir(options);
可用性
iOS、Android、HarmonyOS系统
可提供的1.0.0及更高版本
rmdir
删除文件目录,里面的所有文件将会一起被删除
uni-app项目中(nvue)调用示例:
import { rmdir } from "@/uni_modules/XF-fileSystemUTS"
rmdir({
path: "",
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { rmdir } from "@/uni_modules/XF-fileSystemUTS";
import { SystemOptions } from "@/uni_modules/XF-fileSystemUTS/utssdk/interface.uts";
let options = {
path: "",
complete: (res : any) => {
console.log(res)
}
} as SystemOptions;
rmdir(options);
可用性
iOS、Android、HarmonyOS系统
可提供的1.0.0及更高版本
createFile
创建文件
uni-app项目中(nvue)调用示例:
import { createFile } from "@/uni_modules/XF-fileSystemUTS"
createFile({
path: "",
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { createFile } from "@/uni_modules/XF-fileSystemUTS";
import { SystemOptions } from "@/uni_modules/XF-fileSystemUTS/utssdk/interface.uts";
let options = {
path: "",
complete: (res : any) => {
console.log(res)
}
} as SystemOptions;
createFile(options);
可用性
iOS、Android、HarmonyOS系统
可提供的1.0.0及更高版本
remove
删除文件
uni-app项目中(nvue)调用示例:
import { remove } from "@/uni_modules/XF-fileSystemUTS"
remove({
path: "",
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { remove } from "@/uni_modules/XF-fileSystemUTS";
import { SystemOptions } from "@/uni_modules/XF-fileSystemUTS/utssdk/interface.uts";
let options = {
path: "",
complete: (res : any) => {
console.log(res)
}
} as SystemOptions;
remove(options);
可用性
iOS、Android、HarmonyOS系统
可提供的1.0.0及更高版本
copyTo
拷贝文件
uni-app项目中(nvue)调用示例:
import { copyTo } from "@/uni_modules/XF-fileSystemUTS"
copyTo({
oldPath: "",
newPath: "",
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { copyTo } from "@/uni_modules/XF-fileSystemUTS";
import { CopyOptions } from "@/uni_modules/XF-fileSystemUTS/utssdk/interface.uts";
let options = {
oldPath: "",
newPath: "",
complete: (res : any) => {
console.log(res)
}
} as CopyOptions;
copyTo(options);
可用性
iOS、Android、HarmonyOS系统
可提供的1.0.0及更高版本
moveTo
移动文件
uni-app项目中(nvue)调用示例:
import { moveTo } from "@/uni_modules/XF-fileSystemUTS"
moveTo({
oldPath: "",
newPath: "",
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { moveTo } from "@/uni_modules/XF-fileSystemUTS";
import { CopyOptions } from "@/uni_modules/XF-fileSystemUTS/utssdk/interface.uts";
let options = {
oldPath: "",
newPath: "",
complete: (res : any) => {
console.log(res)
}
} as CopyOptions;
moveTo(options);
可用性
iOS、Android、HarmonyOS系统
可提供的1.0.0及更高版本
rename
重命名
uni-app项目中(nvue)调用示例:
import { rename } from "@/uni_modules/XF-fileSystemUTS"
rename({
oldPath: "",
newPath: "",
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { rename } from "@/uni_modules/XF-fileSystemUTS";
import { CopyOptions } from "@/uni_modules/XF-fileSystemUTS/utssdk/interface.uts";
let options = {
oldPath: "",
newPath: "",
complete: (res : any) => {
console.log(res)
}
} as CopyOptions;
rename(options);
可用性
iOS、Android、HarmonyOS系统
可提供的1.0.0及更高版本
readDir
列出目录
uni-app项目中(nvue)调用示例:
import { readDir } from "@/uni_modules/XF-fileSystemUTS"
readDir({
path: "",
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { readDir } from "@/uni_modules/XF-fileSystemUTS";
import { ListOptions } from "@/uni_modules/XF-fileSystemUTS/utssdk/interface.uts";
let options = {
path: "",
complete: (res : any) => {
console.log(res)
}
} as ListOptions;
readDir(options);
可用性
iOS、Android、HarmonyOS系统
可提供的1.0.0及更高版本