使用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',
即可。
这样,熟悉但有点丑的#又回来了,便不存在兼容性问题,心理踏实啊。