Close physical phone vue elastic return key block

1, open the pop calls window.history.pishState () function

 

2, to close the popup box

 

 

3, mounted lifecycle listeners popstate event

 

 

 4, beforeDestroy lifecycle removed popstate event

 

 Personally I feel that although this method to achieve the effect, but not perfect, more complicated. Message of hope to have good advice!

Guess you like

Origin www.cnblogs.com/xiao-wu-gui/p/12066110.html