svg解码修改,预加载接口修复,文件缓存目录配置

Signed-off-by: zgf <zenggaofeng2@h-partners.com>
This commit is contained in:
zgf 2024-06-14 16:43:16 +08:00
parent 150b75fe8c
commit 0aafb99028
1 changed files with 8 additions and 1 deletions

View File

@ -26,11 +26,18 @@ struct TestPrefetchToFileCachePage {
let fileCachePath = await ImageKnife.getInstance().preLoadCache(url)
console.log("preload-fileCachePath=="+ fileCachePath)
}
async preload1(url:string) {
let fileCachePath = await ImageKnife.getInstance().preLoadCache({ loadSrc: url })
console.log("preload-fileCachePath1=="+ fileCachePath)
}
build() {
Column() {
Button("预加载图片到文件缓存").margin({top:10}).onClick(async ()=>{
Button("url预加载图片到文件缓存").margin({top:10}).onClick(async ()=>{
await this.preload("https://gd-hbimg.huaban.com/e0a25a7cab0d7c2431978726971d61720732728a315ae-57EskW_fw658")
})
Button("option预加载图片到文件缓存").margin({top:10}).onClick(async ()=>{
await this.preload1("https://gd-hbimg.huaban.com/e0a25a7cab0d7c2431978726971d61720732728a315ae-57EskW_fw658")
})
Button("加载图片(预加载后可断网加载)").margin({top:10}).onClick(()=>{
this.imageKnifeOption.loadSrc = "https://gd-hbimg.huaban.com/e0a25a7cab0d7c2431978726971d61720732728a315ae-57EskW_fw658"
})