Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

老司机mpa1的路由不支持history模式?? #3

Closed
zuoye520 opened this issue Nov 11, 2017 · 1 comment
Closed

老司机mpa1的路由不支持history模式?? #3

zuoye520 opened this issue Nov 11, 2017 · 1 comment
Labels

Comments

@zuoye520
Copy link

@zuoye520 zuoye520 commented Nov 11, 2017

http://localhost:8080/web.html#/css

需要支持history模式怎么解决?

@qinshenxue
Copy link
Owner

@qinshenxue qinshenxue commented Nov 13, 2017

已增加分支 mpa1-history-mode-router

关键配置:

// dev.js
historyApiFallback: {
        rewrites: [
            { from: /^\/web/, to: '/web/index.html' },
            { from: /^\/admin/, to: '/admin/index.html' }
        ]
    }
// web/router.js
{
    base: process.env.NODE_ENV === "production" ? '/' : '/web/',
    mode: 'history',
}
// admin/router.js
{
    base: process.env.NODE_ENV === "production" ? '/' : '/admin/',
    mode: 'history',
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants