提交 5051f4ba 编写于 作者: H hdx

fix(long-list): 第二次进入同一个tab白屏问题

上级 98b14364
<template> <template>
<list-view class="list" ref="listView" @scrolltolower="loadData"> <list-view class="list" ref="listView" @scrolltolower="loadData">
<!-- TODO 暂时这样写才能保证 loading 在 list 底部 -->
<template v-for="(item, index) in dataList" :key="index"> <template v-for="(item, index) in dataList" :key="index">
<list-item class="list-item"> <list-item class="list-item">
<view class="list-item-icon"> <view class="list-item-icon">
...@@ -23,7 +24,6 @@ ...@@ -23,7 +24,6 @@
</view> </view>
</view> </view>
</list-item> </list-item>
<!-- TODO 暂时这样写才能保证 loading 在 list 底部 -->
<list-item key="loading" v-if="index==dataList.length-1"> <list-item key="loading" v-if="index==dataList.length-1">
<text class="loading">{{loadingText}}</text> <text class="loading">{{loadingText}}</text>
</list-item> </list-item>
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
} }
.icon-star { .icon-star {
font-family: "UtsIconsFontFamily" !important; font-family: "UtsIconsFontFamily";
font-size: 16px; font-size: 16px;
font-style: normal; font-style: normal;
color: #ffca3e; color: #ffca3e;
......
...@@ -43,8 +43,14 @@ ...@@ -43,8 +43,14 @@
init : Boolean, init : Boolean,
} }
// 测试数据 export default {
const CategoryData = [ components: {
longPage
},
data() {
return {
pageScrollTop: 0,
swiperList: [
{ {
type: 'UpdatedDate', type: 'UpdatedDate',
name: '最新上架' name: '最新上架'
...@@ -61,16 +67,7 @@ ...@@ -61,16 +67,7 @@
type: 'HotList', type: 'HotList',
name: '热门总榜' name: '热门总榜'
} as SwiperViewItem } as SwiperViewItem
] ] as SwiperViewItem[],
export default {
components: {
longPage
},
data() {
return {
pageScrollTop: 0,
swiperList: [] as SwiperViewItem[],
swiperIndex: -1, swiperIndex: -1,
tabsScrollLeft: 0, tabsScrollLeft: 0,
swiperIndicatorLineLeft: 0, swiperIndicatorLineLeft: 0,
...@@ -82,11 +79,6 @@ ...@@ -82,11 +79,6 @@
$isTap: false $isTap: false
} }
}, },
onLoad() {
CategoryData.forEach((item) => {
this.swiperList.push(item)
})
},
onReady() { onReady() {
this.$headerHeight = (this.$refs["header"] as INode)?.offsetHeight as number this.$headerHeight = (this.$refs["header"] as INode)?.offsetHeight as number
this.$swiperWidth = (this.$refs["swiper"] as INode)?.offsetWidth as number this.$swiperWidth = (this.$refs["swiper"] as INode)?.offsetWidth as number
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册