How to force page refresh when using history to return

//e.persisted判断是否后退进入,从缓存冲获取时为true否则为false
window.addEventListener('pageshow', (e) => {
    
    
  if (e.persisted || (window.performance && 
    window.performance.navigation.type == 2)) {
    
    
    location.reload()
  }
}, false)

Guess you like

Origin blog.csdn.net/m0_48076809/article/details/108651531