微信小程序动态获取元素的高度 / 微信小程序动态设置轮播图高度
时间:2020-06-03 12:35:22
收藏:0
阅读:74
1.
<view class="series-list" style="margin-top:{{marginTop}}rpx">
<swiper style="width: 702rpx;height:{{swiperHeight}}px;position: relative" current="{{selectCurrent}}" class="swiper-box" bindchange="swiperChange">
<block wx:for="{{lists}}" wx:key="index">
<swiper-item>
<view style="display:flex;flex-wrap:wrap" class="getHeight">
<view class="series-list-item" wx:for="{{item}}" wx:key="index">
<navigator url="{{‘/pages/search/search?type=tag&tag_id=‘+item.id}}">
<image class="series-list-item-img" src="{{item.picUrl || ‘../../images/home_bg_pic@2x.png‘}}" mode="aspectFit" style="background-image:url({{label_bg_pic_url}})"></image>
<view class="series-list-item-name text-more {{tab == 0 ? ‘index‘ : ‘‘}}">
{{item.rename || item.name}}
</view>
</navigator>
</view>
</view>
</swiper-item>
</block>
</swiper>
<view class="swiperBox" wx:if="{{lists.length >1}}">
<view class="swiperBox1 {{current == index ?‘select‘:‘‘}}" wx:for="{{lists}}" wx:key="index"></view>
</view>
</view>
2.js:

原文:https://www.cnblogs.com/cm521mzg/p/13036282.html
评论(0)