HarmonyOS NavDestination的onShown,在唤起其它 APP 时候也会触发

NavDestination的onShown,照理来说,应该页面显示的时候才触发,但是在唤起其它 APP 的时候也触发了。

代码片段:

build() {
    NavDestination() {
      Column() {
        WebView({
          webViewController: this.webViewController,
          srcUrl: this.pageConfig.srcUrl, //'https://www.huawei.com'
          onWebViewAppear: () => {
            this.webViewController?.setH5cUserAgent()
          }
        })
      }
    }
    .onShown(() => {
      LogUtil.info("show") // 这里在在唤起其它APP时候也会触发
    })
......
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.

断点在唤起其它 APP 时候触发。

期望:

唤起其它 APP 的时候不要触发该onShown事件。

HarmonyOS
2025-01-09 16:01:43
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
zbw_apple
分享
微博
QQ
微信
回复
2025-01-09 18:02:26
相关问题
HarmonyOS 有没有类似deeplink功能唤起app
1319浏览 • 1回复 待解决
HarmonyOS 如何在浏览器唤起app
1720浏览 • 1回复 待解决
HarmonyOS 列表刷新时候
960浏览 • 1回复 待解决