mirror of
https://gitee.com/chu1204505056/vue-admin-beautiful.git
synced 2025-04-26 19:06:35 +08:00
Merge pull request #83 from fwfmiao/master
fix: router history mode 404 error
This commit is contained in:
commit
d49ac8f4e8
@ -3,8 +3,8 @@
|
|||||||
* @description 全局变量配置
|
* @description 全局变量配置
|
||||||
*/
|
*/
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// 开发以及部署时的URL 如"/test/"
|
// 开发以及部署时的URL
|
||||||
publicPath: "",
|
publicPath: "/",
|
||||||
// 生产环境构建文件的目录名
|
// 生产环境构建文件的目录名
|
||||||
outputDir: "dist",
|
outputDir: "dist",
|
||||||
// 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录。
|
// 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录。
|
||||||
|
@ -468,7 +468,7 @@ export const asyncRoutes = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
base: routerMode === "history" ? publicPath : "",
|
base: publicPath,
|
||||||
mode: routerMode,
|
mode: routerMode,
|
||||||
scrollBehavior: () => ({
|
scrollBehavior: () => ({
|
||||||
y: 0,
|
y: 0,
|
||||||
@ -485,7 +485,7 @@ VueRouter.prototype.push = function push(location, onResolve, onReject) {
|
|||||||
|
|
||||||
export function resetRouter() {
|
export function resetRouter() {
|
||||||
router.matcher = new VueRouter({
|
router.matcher = new VueRouter({
|
||||||
base: routerMode === "history" ? publicPath : "",
|
base: publicPath,
|
||||||
mode: routerMode,
|
mode: routerMode,
|
||||||
scrollBehavior: () => ({
|
scrollBehavior: () => ({
|
||||||
y: 0,
|
y: 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user