【问题标题】:Vertical slides in ionic 2ionic 2 中的垂直载玻片
【发布时间】:2016-05-29 14:15:48
【问题描述】:

我正在使用 ionic 2,我想要垂直幻灯片,曾尝试使用 swiper 来实现,还尝试在 ion-slides 的选项(指令)中传递 {direction : vertical}(在 ionic 1.x 中有效) ) 但没有任何效果有没有其他解决方案?

HTML:

<ion-slides pager options="options" style="background-color:white;">

   <ion-slide> 
     <h2>Slide 1</h2>
   </ion-slide>

   <ion-slide>
     <h2>Slide 2</h2>
   </ion-slide>

   <ion-slide>
     <h2>Slide 3</h2>
   </ion-slide>

</ion-slides>

JS:

export class HomePage {
   constructor() {
      this.options = {
         direction: 'vertical'
      };
   }
}

【问题讨论】:

  • 在此处添加一些代码,以便我们为您提供帮助..
  • @SwapnilPatwa ,添加代码,你可以检查它!
  • 这现在适用于最新的 Ionic 2 版本:beta.1
  • @brandyshea 我目前正在使用 ionic 2-beta.17,但无法正常工作
  • beta.17 指的是 CLI 版本,这里有一些关于差异的文档:ionicframework.com/docs/v2/resources/using-npm。请从项目文件夹运行ionic info以查看Ionic Version。 beta.1 的更新日志:github.com/driftyco/ionic/blob/2.0/…

标签: android ios ionic-framework ionic2 slider


【解决方案1】:

只需使用direction="vertical" 属性:

<ion-slides pager direction="vertical">

  <ion-slide>
      //Your html
  </ion-slide>

 </ion-slides>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-10-09
    • 1970-01-01
    • 1970-01-01
    • 2020-07-10
    • 1970-01-01
    • 1970-01-01
    • 2019-01-22
    • 1970-01-01
    相关资源
    最近更新 更多