Confirm before back/navigate to other page

Hi, is there any methods to confirm user before navigating to other pages or back to previous page?
My recent approach is to use e.preventDefault() and adding app.dialog.confirm() on pageBeforeOut at the router component, but I’ve got no success.

No, you have to remove link’s href and “back” class and handle clicks on such links manually using Router API .navigate or .back methods

Ah I got it, thank you very much