window.onhashchange = function(e){ console.log(e); }
打印出來的結果能夠經過location.hash得到瀏覽器url路徑中的#部份內容,上圖是#bvc,若是想獲取#後面的內容可經過location.hash.slice(1),上圖是bvc前端