Angular 2+项目打包之后,刷新访问404解决方法

app.module.ts文件添加两行代码:

import { LocationStrategy, HashLocationStrategy } from '@angular/common';

@ NgModule({
    providers: [
    { provide: LocationStrategy, useClass: HashLocationStrategy },
    ]
})

猜你喜欢

转载自blog.csdn.net/qq_29483485/article/details/80966903
今日推荐