【问题标题】:Angular Swiper width is keeping increase on resizeAngular Swiper 宽度在调整大小时不断增加
【发布时间】:2021-08-17 05:37:22
【问题描述】:

我目前正在 Angular 应用程序上制作横幅,但它无法正常工作。问题是子元素的宽度在调整窗口大小时不断增加。

这是我的代码快照以获取更多信息:

    <swiper
        [slidesPerView]="3"
        [loop]="true"
        [resizeObserver]="true"
        class="spp-swiper"
    >
        <ng-template swiperSlide *ngFor="let article of articles">
            <img class="spp-banner" src="{{ article.img }} />
        </ng-template>
    </swiper>

我正在使用scss作为样式,并且导入了以下swiper模块样式。


@import "./../node_modules/swiper/swiper.scss";
@import "./../node_modules/swiper/components/pagination/pagination.scss";

你有遇到过这样的问题吗?

【问题讨论】:

    标签: angular sass swiper


    【解决方案1】:

    我找到了解决方案,解决方案是将 flex 布局应用于父包装元素。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-18
      • 1970-01-01
      • 1970-01-01
      • 2015-10-05
      • 1970-01-01
      • 1970-01-01
      • 2011-05-29
      相关资源
      最近更新 更多