From 0aafb990284713fc6ac55b64feb644d89ea1b91e Mon Sep 17 00:00:00 2001 From: zgf Date: Fri, 14 Jun 2024 16:43:16 +0800 Subject: [PATCH] =?UTF-8?q?svg=E8=A7=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E9=A2=84=E5=8A=A0=E8=BD=BD=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=EF=BC=8C=E6=96=87=E4=BB=B6=E7=BC=93=E5=AD=98=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zgf --- entry/src/main/ets/pages/TestPrefetchToFileCache.ets | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/entry/src/main/ets/pages/TestPrefetchToFileCache.ets b/entry/src/main/ets/pages/TestPrefetchToFileCache.ets index d6b9e23..eb735a7 100644 --- a/entry/src/main/ets/pages/TestPrefetchToFileCache.ets +++ b/entry/src/main/ets/pages/TestPrefetchToFileCache.ets @@ -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" })