Join GitHub today
the beforeRouteLeave event of vue's first component is not trigger #1951
Steps to reproduce
（2）Press the back button of the browser immediately
（3）Or wait for 2S ,browser will alert('main beforeRouteLeave happened')
my english is poor , that is chinese version as follows:
(3)或者等待2s 出现alert弹框('main beforeRouteLeave happened')
What is expected?
When 'Main' component is mounted，and the function of setTimeout is not happened,Press the back button of the browser immediately. I
What is actually happening?
It is not happen。bug when the code "this.$router.push('/user')" run, will trigger beforeRouteLeave
now, my solution is add component named 'BeforeMain' before Main component.