更新记录
0.0.1(2025-02-18)
- init
平台兼容性
Vue2 | Vue3 |
---|---|
√ | √ |
App | 快应用 | 微信小程序 | 支付宝小程序 | 百度小程序 | 字节小程序 | QQ小程序 |
---|---|---|---|---|---|---|
Android:4.4,iOS:9,HarmonyNext:不确定 | × | × | × | × | × | × |
钉钉小程序 | 快手小程序 | 飞书小程序 | 京东小程序 | 鸿蒙元服务 |
---|---|---|---|---|
× | × | × | × | × |
H5-Safari | Android Browser | 微信浏览器(Android) | QQ浏览器(Android) | Chrome | IE | Edge | Firefox | PC-Safari |
---|---|---|---|---|---|---|---|---|
× | × | × | × | × | × | × | × | × |
lime-zip 压缩解压
- UTS跨平台压缩解压插件,支持密码保护、进度回调。
安装
插件市场导入,在页面引入,自定义基座
注意 本插件是付费,建议:
✅ 先试用后购买
✅ 完成安卓/iOS真机测试
✅ 试用测试满意后,慎重考虑后再购买
代码演示
压缩
支持加密、多路径
sourcePath
: 路径支持文件或文件件
sourcePaths
: 路径数组,可选,同样支持文件或文件夹
password
: 设置密码,可选
import { zip, type ZipOptions } from '@/uni_modules/lime-zip'
zip({
password: '444555', // 可选加密密码
sourcePath: '/static', // 支持文件/文件夹
outputPath: '/storage/backup_${Date.now()}.zip', // 可选输出路径,不写默认则为缓存地址
// sourcePath: '/static/logo.svg',
// sourcePaths: ['/static/mp3/b.mp3', '/static/font/uni.ttf'],
// sourcePaths: ['/static/mp3', '/static/font'],
success(res) {
console.log('zip res', res.tempFilePath)
},
fail(err) {
console.log('err', err)
},
progress(p : number, t : number) {
console.log('进度', p)
console.log('总数', t)
}
} as ZipOptions)
解压
password
: 解压包密码,如果有的话。没有不需要写
zipPath
: 解压包路径
import { unzip, type UnZipOptions } from '@/uni_modules/lime-zip'
unzip({
password: '444555', // 加密压缩包必填,若无密侧忽略
zipPath: res.tempFilePath,
outputPath: '/unpacked', // 可选解压目录
success(res) {
console.log('unzip res', res)
},
fail(err) {
console.log('unzip err', err)
},
progress(p : number, t : number) {
unprogress.value = Math.round((p / t) * 100)
}
} as UnZipOptions)