Ionic 4 Slides - 设置初始幻灯片

Ionic 4 Slides - Set An Initial Slide

是否可以select 将重点显示的幻灯片作为初始幻灯片显示?我有一系列要在 Ionic 幻灯片中显示的项目,我想根据偏好 "preselect"(= 将焦点放在幻灯片上)但保持顺序。

我已经阅读了 Ionic 文档,但我可能遗漏了什么。到目前为止,看起来我需要在页面的构造函数中使用 slideTo 函数,但我一直在寻找直接在 html 模板中使用的指令。

感谢您提供任何信息。

.html

 <ion-slides pager="true" [options]="slideOpts">
      <ion-slide>
        <h1>Slide 1</h1>
      </ion-slide>
      <ion-slide>
        <h1>Slide 2</h1>
      </ion-slide>
      <ion-slide>
        <h1>Slide 3</h1>
      </ion-slide>
    </ion-slides>

.ts

 slideOpts = {
    initialSlide: 2,
    speed: 400
  };

所有选项都在这里http://idangero.us/swiper/api/