hash和history兩種模式的區別

衆所周知,vue-router有兩種模式,hash模式和history模式,這裏來談談二者的區別。前端 hash模式 hash模式背後的原理是onhashchange事件,能夠在window對象上監聽這個事件:vue window.onhashchange = function(event){ console.log(event.oldURL, event.newURL); l
相關文章
相關標籤/搜索