vue router,改路径后页面不工作

Vue router, the page doesn't work after changing the path

我遇到了问题,每当我更改 vue.config.js 和 vue-router 中的路径时,该页面就无法在 XAMMP 中的本地服务器上运行。我已经更改了 publicPath 和 outputPath。

这里有更多详细信息,我把这个 link 放在这里是因为没有人回复。 在下面的 link 中,还有一个 link 到 GitHub 上的存储库:

https://forum.vuejs.org/t/problem-with-vue-routing-on-vue-cli-3-content-doesnt-show-in-the-different-path/55000

感谢您的帮助。我在这里堆得很厉害。

在使用 vue-router 的同时,您还需要在路由器的索引文件中设置路由器基础 属性。 你这样做了吗?? const router = new Router({ mode: 'history', base: /foldername }) 请参阅以下 link 了解更多详情: https://router.vuejs.org/api/#base