Commit 96de2c99d227c854b52b37f432c378d82c7cbc9a

Authored by zhiyangdu
1 parent a2778c0a

去除swiperExce设置容器高度

src/components/tabBox/tabBox.vue
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <van-tab v-for="(item,index) in tabbar" :key="index" :title="item.title"> 5 <van-tab v-for="(item,index) in tabbar" :key="index" :title="item.title">
6 6
7 </van-tab> 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 <div class="tabbar" v-for="(item, index) in tabbaromponents.ads" :key="index"> 9 <div class="tabbar" v-for="(item, index) in tabbaromponents.ads" :key="index">
10 <!-- 关爱屋简介 --> 10 <!-- 关爱屋简介 -->
11 <div class="skeleton brief" ref="brief"> 11 <div class="skeleton brief" ref="brief">
@@ -58,9 +58,6 @@ @@ -58,9 +58,6 @@
58 commoditys: { // 全部推荐 58 commoditys: { // 全部推荐
59 list: [] 59 list: []
60 }, 60 },
61 - swiperExce: { // swiper元素高度,最小高度  
62 - offsetHeight: 0  
63 - },  
64 paging: { // 分页 61 paging: { // 分页
65 commodity: { 62 commodity: {
66 loading: true, 63 loading: true,
@@ -171,13 +168,6 @@ @@ -171,13 +168,6 @@
171 168
172 // 设置还有需要加载的内容 169 // 设置还有需要加载的内容
173 this.$set(this.paging.commodity, "loading", false); 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 } else { 171 } else {
182 172
183 // 没有需要加载的内容,停止上拉加载 173 // 没有需要加载的内容,停止上拉加载
@@ -197,27 +187,6 @@ @@ -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 loadCommodity() { 192 loadCommodity() {