【小程序】微信小程序-滚动消息通知
写在前面:
这次我主要想总结一下微信小程序实现上下滚动消息提醒,主要是利用swiper组件来实现,swiper组件在小程序中是滑块视图容器。
我们通过vertical属性(默认为false,实现默认左右滚动)设置为true来实现上下滚动。
(需要注意的是:只要你的swiper存在vertical属性,无论你给值为true或者false或者不设参数值,都将实现上下滚动)
从深圳回来做了一个微信小程序的小项目,令人欣慰的一点事是,回来很快时间内把在深圳两天的房租给赚回来了,哈哈...
wxml
复制代码
1 <swiper class="swiper_container" vertical="true" autoplay="true" circular="true" interval="2000">
2 <block wx:for="{ {msgList}}">
3 <navigator url="/pages/index/index?title={ {item.url}}" open-type="navigate">
4 <swiper-item>
5 <view class="swiper_item">{ {item.title}}</view>
6 </swiper-item>
7 </navigator>
8 </block
写在前面:
这次我主要想总结一下微信小程序实现上下滚动消息提醒,主要是利用swiper组件来实现,swiper组件在小程序中是滑块视图容器。
我们通过vertical属性(默认为false,实现默认左右滚动)设置为true来实现上下滚动。
(需要注意的是:只要你的swiper存在vertical属性,无论你给值为true或者false或者不设参数值,都将实现上下滚动)
从深圳回来做了一个微信小程序的小项目,令人欣慰的一点事是,回来很快时间内把在深圳两天的房租给赚回来了,哈哈...
wxml
复制代码
1 <swiper class="swiper_container" vertical="true" autoplay="true" circular="true" interval="2000">
2 <block wx:for="{ {msgList}}">
3 <navigator url="/pages/index/index?title={ {item.url}}" open-type="navigate">
4 <swiper-item>
5 <view class="swiper_item">{ {item.title}}</view>
6 </swiper-item>
7 </navigator>
8 </block

最低0.47元/天 解锁文章
6925

被折叠的 条评论
为什么被折叠?



