wxml代码

<view class="notice">
<view class="title">公告:</view>
<swiper class="swiper_container" vertical="true" autoplay="true" circular="true" interval="2000">
    <block wx:for="{{msgList}}" wx:key="{{item}}">
      <navigator url="/pages/index/index?title={{item.url}}" open-type="navigate">
        <swiper-item>
          <view class="swiper_item">{{item.title}}</view>
        </swiper-item>
      </navigator>
    </block>
  </swiper>
  </view>

数据js

msgList: [
{ url: "url", title: "多地首套房贷利率上浮 热点城市渐迎零折扣时代" },
{ url: "url", title: "悦如公寓三周年生日趴邀你免费吃喝欢唱城市渐迎零折扣时代" },
{ url: "url", title: "你想和一群有志青年一起过生日嘛?" }],
wxss样式

.notice {
 width: 750rpx;
 position: relative;
 margin-top:12rpx;
 }
.notice .title{
 width: 151rpx; 
 float: left;
 text-align: center;
 font-size: 30rpx;
 line-height:55rpx;
}
.notice .swiper_container {
height: 55rpx;
width: 600rpx;
line-height:55rpx;
float: right;
}

标签: 小程序开发, 小程序

添加新评论