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

Comments

Projects
None yet
2 participants
@zuoye520

zuoye520 commented Nov 11, 2017

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

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

@qinshenxue

This comment has been minimized.

Owner

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