The problem of using "stackPages: true" with "beforeLeave" in routing

The homepage, 1, 2, and 3 pages, the association between the pages is from the homepage to 1 page, 1 page to 2 pages, 2 pages jump to 3 pages, where the 2page route joins the beforeLeave event, if stackPages: true When returning from the 3 page to the 2 page, the beforeLeave event will also be triggered, and stackPages: false will not be triggered. This problem is bothering me.

Show a minimal example on jsfiddle