使用vue cli 3.x 創建的項目,有一個選項:
Use history mode for router? (Requires proper server setup for index fallback in production)(Y/n)
選了Y。
但查了后,發現ie瀏覽器history模式只支持10及以上, https://caniuse.com/#search=history
如何改回來hash模式?
打開/src/router.js
修改
mode: 'history',
為
mode: 'hash',
即可。
這樣,熟悉但有點丑的#又回來了,便不存在兼容性問題,心理踏實啊。