【问题标题】:White slide appears when using Angular-Bootstrap Carousel使用 Angular-Bootstrap Carousel 时出现白色幻灯片
【发布时间】:2021-08-04 14:27:49
【问题描述】:

这是我第一次在 Angular 中使用 Bootstrap 的轮播元素,我遇到了一个奇怪的问题,即每次转换之前都会出现白色幻灯片(参见下面的 gif)。我按照 ng-bootstrap Github 页面上的所有基本步骤进行设置,但找不到问题。以下是相关文件:

当前问题的 Gif: https://ibb.co/p38LP4X

home.html

...
<ngb-carousel *ngIf="images" [interval]="5000" [pauseOnHover]="pauseOnHover" [pauseOnFocus]="pauseOnFocus">
        <ng-template ngbSlide *ngFor="let img of images; index as i">
            <div class="carousel-caption">
                <h1>AS SOLID AS THEY COME</h1>
            </div>
            <div class="img-wrapper">
                <img [src]="img" alt="My image {{i + 1}} description">
            </div>
        </ng-template>
    </ngb-carousel>
...

angular.json

...
            "styles": [
              "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "src/styles.css"
...

我还在 index.html 中包含另一个引导程序版本,因为仅使用 angular.json 中的引导程序版本根本无法使轮播功能发挥作用。

index.html

<head>
...
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" />
...
</head>

【问题讨论】:

    标签: angular typescript


    【解决方案1】:

    我遇到了同样的问题,从位置 ../node_modules/@angular/compiler-cli/ngcc/ngcc_lock_file 删除 ngcc_lock_file 文件对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-15
      • 1970-01-01
      • 1970-01-01
      • 2023-03-25
      • 2013-02-05
      • 2015-07-17
      • 2015-07-13
      • 1970-01-01
      相关资源
      最近更新 更多