Commit 96de2c99d227c854b52b37f432c378d82c7cbc9a
1 parent
a2778c0a
去除swiperExce设置容器高度
Showing
1 changed file
with
1 additions
and
32 deletions
src/components/tabBox/tabBox.vue
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | <van-tab v-for="(item,index) in tabbar" :key="index" :title="item.title"> |
| 6 | 6 | |
| 7 | 7 | </van-tab> |
| 8 | - <div class="tabBox_main" :style="{height: swiperExce.offsetHeight + 'px', minHeight: 'calc(100vh - ' + ($parent.$parent.top.value + 'px') + ' - 520px)'}" ref="tabsSwiperBox"> | |
| 8 | + <div class="tabBox_main" ref="tabsSwiperBox"> | |
| 9 | 9 | <div class="tabbar" v-for="(item, index) in tabbaromponents.ads" :key="index"> |
| 10 | 10 | <!-- 关爱屋简介 --> |
| 11 | 11 | <div class="skeleton brief" ref="brief"> |
| ... | ... | @@ -58,9 +58,6 @@ |
| 58 | 58 | commoditys: { // 全部推荐 |
| 59 | 59 | list: [] |
| 60 | 60 | }, |
| 61 | - swiperExce: { // swiper元素高度,最小高度 | |
| 62 | - offsetHeight: 0 | |
| 63 | - }, | |
| 64 | 61 | paging: { // 分页 |
| 65 | 62 | commodity: { |
| 66 | 63 | loading: true, |
| ... | ... | @@ -171,13 +168,6 @@ |
| 171 | 168 | |
| 172 | 169 | // 设置还有需要加载的内容 |
| 173 | 170 | this.$set(this.paging.commodity, "loading", false); |
| 174 | - // 如果当前显示“全部商品”,设置swiper高度 | |
| 175 | - this.$nextTick(() => { | |
| 176 | - setTimeout(() => { | |
| 177 | - // 重新设置swiper高度 | |
| 178 | - this.$set(this.swiperExce, "offsetHeight", this.$refs.commodity[0].offsetHeight); | |
| 179 | - }, 500); | |
| 180 | - }); | |
| 181 | 171 | } else { |
| 182 | 172 | |
| 183 | 173 | // 没有需要加载的内容,停止上拉加载 |
| ... | ... | @@ -197,27 +187,6 @@ |
| 197 | 187 | } |
| 198 | 188 | }, |
| 199 | 189 | /** |
| 200 | - * 设置swiper高度 | |
| 201 | - */ | |
| 202 | - setSwiperHeight(title) { | |
| 203 | - | |
| 204 | - this.$nextTick(() => { | |
| 205 | - | |
| 206 | - // 设置swiper高度 | |
| 207 | - switch (title) { | |
| 208 | - case '关爱屋': | |
| 209 | - this.$set(this.swiperExce, "offsetHeight", this.$refs.brief[0].offsetHeight); | |
| 210 | - break; | |
| 211 | - case '精品推荐': | |
| 212 | - this.$set(this.swiperExce, "offsetHeight", this.$refs.boutique[0].offsetHeight); | |
| 213 | - break; | |
| 214 | - case '全部商品': | |
| 215 | - this.$set(this.swiperExce, "offsetHeight", this.$refs.commodity[0].offsetHeight); | |
| 216 | - break; | |
| 217 | - } | |
| 218 | - }); | |
| 219 | - }, | |
| 220 | - /** | |
| 221 | 190 | * 上拉加载“爱心屋项目全部商品” |
| 222 | 191 | */ |
| 223 | 192 | loadCommodity() { | ... | ... |