1.0.2 • Published 2 years ago
tb-assets v1.0.2
@tbmini/tb-assets
资源自动上传插件
安装
在 Taro 项目根目录下安装
$ npm i @tbmini/tb-assets --save
使用
API
startUpload (Promise)
// 参数
{
cdnFolderName?: 默认值 taobaomini // cdn路径地址
projectName?: string // 项目名称
resPath?: './assets/'
min?: true
distPath?: './assetsTemp/'
ossConfig: OssConfig //oss配置
}
上传资源
getPreLoadImg
获取预加载资源列表
// 参数
assetlist.json 路径
// 示例
const imgList = getPreLoadImg(jsonPath)