35 lines
623 B
JavaScript
35 lines
623 B
JavaScript
const imageCdn = 'https://tdesign.gtimg.com/mobile/demos';
|
|
const swiperList = [
|
|
`${imageCdn}/swiper1.png`,
|
|
`${imageCdn}/swiper2.png`,
|
|
`${imageCdn}/swiper1.png`,
|
|
`${imageCdn}/swiper2.png`,
|
|
`${imageCdn}/swiper1.png`,
|
|
];
|
|
|
|
Component({
|
|
data: {
|
|
current: 0,
|
|
autoplay: false,
|
|
duration: 500,
|
|
interval: 5000,
|
|
swiperList,
|
|
},
|
|
|
|
methods: {
|
|
onTap(e) {
|
|
const { index } = e.detail;
|
|
|
|
console.log(index);
|
|
},
|
|
onChange(e) {
|
|
const { current, source } = e.detail;
|
|
|
|
console.log(current, source);
|
|
},
|
|
onImageLoad(e) {
|
|
console.log(e.detail.index);
|
|
},
|
|
},
|
|
});
|