使用Swiper组件来实现滑动视图。@Entry @Component struct SwiperComponent { private images: string[] = [ 'common/picture1.png', 'common/picture2.png', 'common/picture3.png' ]; build() { Swiper({ loop: true, autoplay: true, interval: 3000, duration: 500 }) .dataSource(this.images) .onCurrentIndexChange((index) => { console.log(`当前索引:${index}`); }) .build(); } }参见:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides...本文参与了 【 HarmonyOS NEXT 技术问答冲榜,等你来战!】欢迎正在阅读的你也加入。
使用Swiper组件来实现滑动视图。
参见:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides...
本文参与了 【 HarmonyOS NEXT 技术问答冲榜,等你来战!】欢迎正在阅读的你也加入。