1. hash

修改的时候:history.pushState('名字', null, '/xxx') || location.hash = '/xxx'

回退的时候:window.addEventListener('statepop' || 'hashchange')

 

2. history

修改的时候:history.pushState('名字', null, '/xxx')

回退的时候:window.addEventListener('statepop')

 

相关文章: