✨️index
title swiper list(grid)
import coms from '../pages/com'
@Entry
@Component
struct Index {
@State message: string = 'Hello World1'
//private list = new con
build() {
Column() {
//标题
Row(){
Text('photos')
.fontSize('30fp')
.fontWeight(FontWeight.Bold)
}
.justifyContent(FlexAlign.Start)
.width('100%')
.padding('12vp')
//轮播
Swiper() {
ForEach(coms.SWIPERLIST,(item:Resource,index?:Number)=>{
Row() {
Image(item)
}
.width('100%')
.aspectRatio(1.6)
})
}
.autoPlay(true)
.loop(true)
.indicator(true)
.duration(1000)
.itemSpace(10)
.borderRadius('12vp')
.margin('12vp')
.onChange((index: number)