hash和history两种模式的区别

众所周知,vue-router有两种模式,hash模式和history模式,这里来谈谈二者的区别。前端 hash模式 hash模式背后的原理是onhashchange事件,能够在window对象上监听这个事件:vue window.onhashchange = function(event){ console.log(event.oldURL, event.newURL); l
相关文章
相关标签/搜索