-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TabBar 标签栏]中 wx.switchTab({url}) 与 that.setData({ value: value, }); 共存会导致显示异常 #2378
Comments
👋 @ryiot,感谢给 TDesign 提出了 issue。 |
看看是否有报错信息 wx.switchTab({
url,
complete: (res) => {
console.log(res);
},
}); |
无报错信息 |
在onchange方法中去更新globalData中的value值
在自定义tarbar中的attach生命周期中执行
|
tdesign-miniprogram 版本
1.2.3
重现链接
No response
重现步骤
Component({
{{item.label}}data: {
value: 'home',
list: [
{ value: 'home', label: '首页', icon: 'home' },
{ value: 'family', label: '家庭', icon: 'app' },
{ value: 'me', label: '我的', icon: 'user' },
],
},
methods: {
onChange(e) {
let that = this;
const value = e.detail.value;
that.setData({
value: value,
});
const url = '/pages/' + that.data.value + '/index';
wx.switchTab({url})
},
},
});
{
"component": true,
"usingComponents": {
"t-tab-bar": "tdesign-miniprogram/tab-bar/tab-bar",
"t-tab-bar-item": "tdesign-miniprogram/tab-bar-item/tab-bar-item"
}
}
期望结果
实际结果
基础库版本
2.19.6
补充说明
No response
The text was updated successfully, but these errors were encountered: