Skip to content

Commit 0359e96

Browse files
committed
fix: 处理在 mp-baidu 中获取不到自定义参数的问题
1 parent 01a8279 commit 0359e96

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎pages/template/tabbar/tabbar.vue‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<view class="uni-tab-bar">
33
<scroll-view id="tab-bar" class="uni-swiper-tab" scroll-x :scroll-left="scrollLeft">
44
<view v-for="(tab,index) in tabBars" :key="tab.id" :class="['swiper-tab-list',tabIndex==index ? 'active' : '']"
5-
:id="tab.id" :data-current="index" @tap="tapTab">{{tab.name}}</view>
5+
:id="tab.id" :data-current="index" @click="tapTab(index)">{{tab.name}}</view>
66
</scroll-view>
77
<swiper :current="tabIndex" class="swiper-box" duration="300" @change="changeTab">
88
<swiper-item v-for="(tab,index1) in newsitems" :key="index1">
@@ -154,7 +154,7 @@
154154
this.newsitems[e].loadingType = 1;
155155
},
156156
async changeTab(e) {
157-
let index = e.target.current;
157+
let index = e.detail.current;
158158
if (this.isClickChange) {
159159
this.tabIndex = index;
160160
this.isClickChange = false;
@@ -190,15 +190,15 @@
190190
}).exec();
191191
})
192192
},
193-
async tapTab(e) { //点击tab-bar
194-
if (this.tabIndex === e.target.dataset.current) {
193+
async tapTab(index) { //点击tab-bar
194+
if (this.tabIndex === index) {
195195
return false;
196196
} else {
197197
let tabBar = await this.getElSize("tab-bar"),
198198
tabBarScrollLeft = tabBar.scrollLeft; //点击的时候记录并设置scrollLeft
199199
this.scrollLeft = tabBarScrollLeft;
200200
this.isClickChange = true;
201-
this.tabIndex = e.target.dataset.current
201+
this.tabIndex = index;
202202
}
203203
},
204204
randomfn() {

0 commit comments

Comments
 (0)