路由模式有两种
#
符号,如 http://localhost/#/login
#
符号,如 http://localhost/login
修改路由配置,代码如下:
export default new Router({ mode: ‘history‘, routes: [ ] });
创建一个名为 NotFound.vue
的视图组件,代码如下:
<template> <div> 页面不存在,请重试! </div> </template> <script> export default { name: "NotFount" } </script> <style scoped> </style>
修改路由配置,代码如下:
{ path: ‘*‘, component: NotFound }
原文:https://www.cnblogs.com/xianquan/p/12493518.html