mode模式
mode取值说明:
history:URL不显示#,示例:http://localhost:8080/homehash:默认值,会多一个#,示例:http://localhost:8080/#/home
1 | export default new Router({ |
404页面设置
如果访问路由不存在,或用户输入错误,给一个404提示页面。
- 在src/router/index.js中加入代码:
1 | // 404 |
- 编写src/components/404.vue页面:
1 | <template> |