#鸿蒙学习大百科#如何拦截Navigation路由?

如何拦截Navigation路由?

HarmonyOS
2024-10-12 08:36:22
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
耗子煨汁r
this.pathStack.setInterception({
  willShow: (from: NavDestinationContext | NavBar, to: NavDestinationContext | NavBar,
    operation: NavigationOperation, isAnimated: boolean) => {
    // 页面跳转前拦截,允许操作栈,在当前跳转中生效。
  },
  didShow: (from: NavDestinationContext | NavBar, to: NavDestinationContext | NavBar,
    operation: NavigationOperation, isAnimated: boolean) => {
    //页面跳转后回调。在该回调中操作栈在下一次跳转中刷新,
  },
  modeChange: (mode: NavigationMode) => {
    //Navigation单双栏显示状态发生变更时触发该回调
  }
})
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
分享
微博
QQ
微信
回复
2024-10-12 15:05:19


相关问题