v4 的升级
Vue-router v4 升级之后,mode: 'xxx'
替换为 API 的形式,但功能是一样的
mode: 'hash'
替换为createWebHashHistory()
mode: 'history'
替换为createWebHistory()
mode: 'abstract'
替换为createMemoryHistory()
PS:个人感觉,叫 memory
比叫 abstract
更易理解,前者顾名思义,后者就过于抽象。
hash
// http://127.0.0.1:8881/hash.html?a=100&b=20#/aaa/bbb
location.protocol // 'http:'
location.hostname // '127.0.0.1'
location.host // '127.0.0.1:88