王士厅

人民号文章稿件中的图片滑动时,图片和对应数字不能同步显示

@@ -74,9 +74,9 @@ export struct MultiPictureListPage { @@ -74,9 +74,9 @@ export struct MultiPictureListPage {
74 center: { anchor: "__container__", align: VerticalAlign.Center }, 74 center: { anchor: "__container__", align: VerticalAlign.Center },
75 middle: { anchor: "__container__", align: HorizontalAlign.Center } 75 middle: { anchor: "__container__", align: HorizontalAlign.Center }
76 }) 76 })
77 - .onChange((index: number) => {  
78 - this.swiperIndex = index  
79 - this.currentUrl = this.photoList[index]?.picPath 77 + .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => {
  78 + this.swiperIndex = targetIndex
  79 + this.currentUrl = this.photoList[targetIndex]?.picPath
80 }) 80 })
81 81
82 Row() { 82 Row() {