Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Webpack Vue.js历史记录模式自定义404页面_Webpack_Vue.js_Vuejs2_Vue Router - Fatal编程技术网

Webpack Vue.js历史记录模式自定义404页面

Webpack Vue.js历史记录模式自定义404页面,webpack,vue.js,vuejs2,vue-router,Webpack,Vue.js,Vuejs2,Vue Router,我已经用Vue.js制作了一个管理模板应用程序 网址: 一切似乎都很好。但我无法在我的VPS主机上配置404页面。因为如果我去直接的网址 然后显示nginx404。我想显示我的模板的404页 如何使用模板的404页面进行自定义 谢谢在路由所在的文件中,您需要使用“*”通配符定义404组件的路径: ... routes: [ // Other paths and their children... ... // Any other paths must return your 404C

我已经用Vue.js制作了一个管理模板应用程序 网址:

一切似乎都很好。但我无法在我的VPS主机上配置404页面。因为如果我去直接的网址 然后显示nginx404。我想显示我的模板的404页

如何使用模板的404页面进行自定义


谢谢

在路由所在的文件中,您需要使用“*”通配符定义404组件的路径:

...
routes: [
  // Other paths and their children...
  ...
  // Any other paths must return your 404Component now
  { path: '*', component: 404Component },
]
我对其进行了更改,如
{path:'*',redirect:{name:'Page404',component:Page404}},但仍然无法在实时URL上运行: