angular – 将水平滚动条添加到Ionic2的离子滑轨
发布时间:2020-12-17 17:41:54 所属栏目:安全 来源:网络整理
导读:我正在使用Ionic2的 ion-slides ,它对我来说很好. ion-slides [options]="extraOptions" ion-slide *ngFor="let slide of slides" img src="{{slide.image}}" / /ion-slide /ion-slides 我想在Swiper API http://idangero.us/swiper/api/#.V6Lcx8twbqA(第13
我正在使用Ionic2的
ion-slides ,它对我来说很好.
<ion-slides [options]="extraOptions"> <ion-slide *ngFor="let slide of slides"> <img src="{{slide.image}}" /> </ion-slide> </ion-slides> 我想在Swiper API http://idangero.us/swiper/api/#.V6Lcx8twbqA(第13个例子)中添加一个水平滚动条,因为文档提到Swiper是用于离子滑动的东西. source code for that example有< div class =“swiper-scrollbar”>< / div>在< div class =“swiper-wrapper”>之后标签. 问题是Ionic会生成HTML,所以如何添加滚动条功能. 要向滑块添加分页项目符号,我只需要在ion-slides标记中添加分页器属性指令.是否有类似的horizental滚动条? 解决方法
这不能通过Ionic的离子滑动组件来完成.见其中一位作者的回复:
https://forum.ionicframework.com/t/how-to-add-horizontal-scrollbar-to-slides/59450/3?u=brightpixels
Not at the moment. We've tried to keep the Slides API much simpler than the original Swiper API. But we plan on revisiting this post 2.0 final 我已经通过直接使用swiper库并创建自己的组件来解决这个问题. >通过npm安装模块:npm install swiper>在组件文件的顶部声明var require>然后var swiper = require(‘swiper’) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |