Angular 无法在ngx引导的多幻灯片旋转木马中渲染图像

Angular 无法在ngx引导的多幻灯片旋转木马中渲染图像,angular,bootstrap-4,ngx-bootstrap,Angular,Bootstrap 4,Ngx Bootstrap,所以我使用的是ngx引导。当我使用单图像转盘时,它工作得很好,但在多图像中,我得到的只是左侧的第一个图像,没有其他任何图像 <p> If `true` - carousel indicators indicate slides chunks works ONLY if singleSlideOffset = FALSE </p> <carousel [itemsPerSlide]="itemsPerSlide" [singleSlideOff

所以我使用的是ngx引导。当我使用单图像转盘时,它工作得很好,但在多图像中,我得到的只是左侧的第一个图像,没有其他任何图像

<p>
  If `true` - carousel indicators indicate slides chunks works ONLY if singleSlideOffset = FALSE
</p>
<carousel [itemsPerSlide]="itemsPerSlide"
          [singleSlideOffset]="false"
          [interval]="false"
          [indicatorsByChunk]="true">
  <slide *ngFor="let slide of slides; let index=index">
    <img [src]="slide.image" alt="image slide" style="display: block; width: 100%;">
    <div class="carousel-caption">
      <h4>Slide {{index}}</h4>
    </div>
  </slide>
</carousel>
顺便说一句,这段代码来自ngx引导文档和我从谷歌(google)挑选的图片。我知道,如果文档代码不起作用,这不是一个好迹象,但可能我遗漏了一些东西,如果有人可能遇到类似问题,可以帮助我,我会很高兴。

您好,请在幻灯片中添加这个类mx auto,为我工作::

  <slide *ngFor="let slide of slides; let index=index" class="mx-auto">
     ...
  </slide>
您好,请在幻灯片中添加这个类mx auto,为我工作::

  <slide *ngFor="let slide of slides; let index=index" class="mx-auto">
     ...
  </slide>

像这样删除添加的属性

<carousel>
  <slide *ngFor="let slide of slides; let index=index">
    <img [src]="slide.image" alt="image slide" style="display: block; width: 100%;">
    <div class="carousel-caption">
      <h4>Slide {{index}}</h4>
    </div>
  </slide>
</carousel>

像这样删除添加的属性

<carousel>
  <slide *ngFor="let slide of slides; let index=index">
    <img [src]="slide.image" alt="image slide" style="display: block; width: 100%;">
    <div class="carousel-caption">
      <h4>Slide {{index}}</h4>
    </div>
  </slide>
</carousel>

非常感谢,真不敢相信这是保证金问题。我很惊讶文档代码不能正常工作。是的,我以前也遇到过同样的问题,因为在bootstrap 4.3.1中,img响应类被img fluid替换,而中间块被mx auto替换,但最后一个应该在标记内部使用,因为宽度属性不再设置。资料来源:非常感谢,真不敢相信这是保证金问题。我很惊讶文档代码不能正常工作。是的,我以前也遇到过同样的问题,因为在bootstrap 4.3.1中,img响应类被img fluid替换,而中间块被mx auto替换,但最后一个应该在标记内部使用,因为宽度属性不再设置。资料来源: