Explorar el Código

fix(webview): 修改缓存模式为在线优先

- 将WebView的缓存模式从None更改为Online
- 确保网页内容优先从网络加载
-保持其他WebView配置不变
徐勤民 hace 1 semana
padre
commit
717e165f47
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/main/ets/pages/XWebview.ets

+ 1 - 1
src/main/ets/pages/XWebview.ets

@@ -191,7 +191,7 @@ export struct XWebview {
           .mixedMode(MixedMode.All)//允许加载HTTP和HTTPS混合内容
           .zoomAccess(this.zoomAccess ?? false)//不支持手势进行缩放
           .mediaPlayGestureAccess(false)//有声视频播放不需要用户手动点击
-          .cacheMode(CacheMode.None)//设置缓存模式
+          .cacheMode(CacheMode.Online)//设置缓存模式
           .onConfirm((event) => { // 自定义Confirm弹窗
             if (event) {
               console.log("event.url:" + event.url)