Preventing router from navigating

后端 未结 2 1480
慢半拍i
慢半拍i 2021-01-25 07:07

I need to prevent router to be navigated to another page (which is done by changing the hash) if some changes are made. Tried with HashChanger but it just fires \'hashChange\' e

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-25 07:21

    There is a stop function on the router https://sapui5.hana.ondemand.com/#/api/sap.ui.core.routing.Router/methods/stop

    if you call it, the router will stop listening to hashchanges.

    There is also function isStopped(). To (re-)activate the router, call initialize(...).

提交回复
热议问题