vue-router两种模式:hash模式和history模式

为了构建SPA,vue引入了前端路由系统vue-router。 vue-route有两种模式:history模式和hash模式。html 1. hash模式(vue-router默认hash模式) hash模式背后的原理是onhashchange事件。前端 window.onhashchange=function(){ let hash=location.hash.slice(1); docu
相关文章
相关标签/搜索