Skip to content

Commit 9ffe30b

Browse files
committed
fix: 修复原生顶部选项卡下拉刷新Bug
1 parent a175970 commit 9ffe30b

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

‎pages/template/tabbar-native/tabbar-native.nvue‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<template>
22
<view class="tabs">
33
<scroll-view id="tab-bar" class="scroll-h" :scroll-x="true" :show-scrollbar="false" :scroll-into-view="scrollInto">
4-
<view v-for="(tab,index) in tabBars" :key="tab.id" class="uni-tab-item" :id="tab.id" :data-current="index"
5-
@click="ontabtap">
4+
<view v-for="(tab,index) in tabBars" :key="tab.id" class="uni-tab-item" :id="tab.id" :data-current="index" @click="ontabtap">
65
<text class="uni-tab-item-title" :class="tabIndex==index ? 'uni-tab-item-title-active' : ''">{{tab.name}}</text>
76
</view>
87
</scroll-view>
@@ -13,8 +12,7 @@
1312
<!-- #ifdef APP-PLUS-NVUE -->
1413
<refresh class="refresh" @refresh="onrefresh(index1)" @pullingdown="onpullingdown" :display="tab.refreshing ? 'show' : 'hide'">
1514
<div class="refresh-view">
16-
<image class="refresh-icon" :src="refreshIcon" :style="{width: (tab.refreshing || pulling) ? 0: '32px'}"
17-
:class="{'refresh-icon-active': tab.refreshFlag}"></image>
15+
<image class="refresh-icon" :src="refreshIcon" :style="{width: (tab.refreshing || pulling) ? 0: '32px'}" :class="{'refresh-icon-active': tab.refreshFlag}"></image>
1816
<image class="loading-icon" :src="loadingIcon" v-if="tab.refreshing"></image>
1917
<text class="loading-text">{{tab.refreshText}}</text>
2018
</div>
@@ -142,6 +140,7 @@
142140
this.tabBars.forEach((tabBar) => {
143141
this.newsList.push({
144142
data: [],
143+
refreshText: "",
145144
loadingText: '加载更多...'
146145
});
147146
});
@@ -171,14 +170,14 @@
171170
}, 200)
172171
},
173172
close(index1, index2) {
174-
uni.showModal({
175-
content: '是否删除本条信息?',
176-
success: (res) => {
177-
if (res.confirm) {
178-
this.newsList[index1].data.splice(index2, 1);
179-
}
180-
}
181-
})
173+
uni.showModal({
174+
content: '是否删除本条信息?',
175+
success: (res) => {
176+
if (res.confirm) {
177+
this.newsList[index1].data.splice(index2, 1);
178+
}
179+
}
180+
})
182181
},
183182
loadMore(e) {
184183
setTimeout(() => {

0 commit comments

Comments
 (0)