微信小程序(三)页面跳转和图片滑动切换
跳转部分:
在index2.wxml中,添加跳转函数,如下所示:
wxml代码:
<!--pages/list/list.wxml--> <view> <swiper indicator-dots indicator-color='yellowgreen' indicator-active-color='pink'> <swiper-item> <image src="/static/images/a.jpg"></image> </swiper-item> <swiper-item> <image src="/static/images/y.jpg"></image> </swiper-item> <swiper-item> <image src="/static/images/s.jpg"></image> </swiper-item> <swiper-item> <image src="/static/images/t.jpg"></image> </swiper-item> </swiper> </view>
wxss样式代码如下:
swiper{
width:100%;
height:400rpx;
}
swiper image{
width:100%;
height:100%;
}
抓住每一次机遇,笨鸟先飞,加油!