编程语言
首页 > 编程语言> > 微信小程序 公告上下滚动

微信小程序 公告上下滚动

作者:互联网

<!--公告-->
      <!-- <view class="notice_box">
        <view class="notice">
          <image src="/images/notice-icon.png"></image>
        </view>

        <view class="swiper_box">
          <swiper 
              vertical="true"
              autoplay="true" 
              circular="true"
              interval="3000"
              duration='300'
              easing-function='easeInOutCubic'>
            <block wx:for='{{msgList}}' wx:key='index'>
                <swiper-item>
                  <view class="swiper-item">
                    <span class="newsp">最新</span>
                    <text class="notice-title">{{item.title}}</text>
                  </view>
                </swiper-item>
            </block>
          </swiper>
        </view> 
      </view> -->
      <!--公告-->

 

/*
*公告栏
*/
.notice_box{
  /* margin:   0 20rpx; */
  width: 95%;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  height: 80rpx;
  background-color: white;
}
.notice{
  padding: 0 20rpx;
  display: flex;
  align-items: center;
}
.notice_box swiper{
  height: 40px!important;
}
.notice image{
  width: 90px;
  height: 17px;
}
.swiper_box{
  width: 100%;
  padding-top: 22rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 2px;
}
.swiper-item {
  font-size: 12px;
  display: flex;
}
.newsp{
  color: #DE797D;
  font-size: 11px;
  background-color: #FBEDED;
  text-align: center;
  width: 31px;
  border-radius: 3px;
  display: block;
  height: 16px;
}
.notice-title{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space: nowrap;
  color:#343434;
  padding-left:6px;
}

 

msgList的数据

msgList:[
      { title: '河南,咱们一起扛' },
      { title: '女足首战' },
      { title: '雄鹿总冠军!!!' }
],

 

标签:flex,notice,滚动,title,color,微信,height,width,上下
来源: https://www.cnblogs.com/QW-lzm/p/15040522.html