angular - Angular Swiper 宽度在调整大小时不断增加
问题描述
我目前正在 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";
你有没有遇到过这样的问题?
解决方案
我找到了解决方案,解决方案是将 flex 布局应用于父包装元素。
推荐阅读
- php - 尝试上传 go daddy 时出错:找不到类 '\App\User'
- python - 使用条件,在 pandas DataFrame 中选择所需的列
- react-native - 反应原生平面列表滚动深度?
- javascript - JS Accordion 在单击内部链接时关闭
- jquery - 如何使用 jquery.validate.min.js 验证 AJAX 表单
- ruby-on-rails - Yarn Registry 总是返回 503 Unavailable
- python - Python:对列表中的相似文本进行分组
- javascript - 如何更改 node-soap 服务器响应的 HTTP 标头?
- vue.js - Vue.js Textarea在keyDown事件上调整大小,如何获取样式属性?
- reactjs - JS fiddle React js外部资源问题