首页 > 解决方案 > 部署失败时的角度 6 路由

问题描述

在我的本地,我运行解决方案,ng serve --base-href "/grant并且我的网站和路由正常工作。当我部署并ng build --base-href /grant/通过构建运行时,输出的网站有不正确的链接路由,没有添加 /grant/。我也试过ng build --base-href "/grant没有成功

我的路线:

  const routes: Routes = [
  {
    path: '',
    component: SetupComponent
  },
  {
    path: 'new-login',
    component: NewLoginComponent
  }

标签: angular

解决方案


推荐阅读