Skip to content
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

[Bug Report] tab标签组件在使用动态数据时,第一个选中状态的下标线会偏移到最左侧 #5135

Closed
jirentech opened this issue Dec 9, 2022 · 8 comments

Comments

@jirentech
Copy link

重现链接

<van-tabs swipeable sticky :active="active" @change="onChange">

链接


Vant Weapp 版本

v1.10.7

描述一下你遇到的问题。

[tab标签组件在使用动态数据的时候,默认的active,即第一个选择状态的下标线会偏移到最左侧]
微信截图_20221209153054

重现步骤

tab标签组件在使用动态数据(动态数据通过网络请求获得)的时候,即第一个选中状态的下标线会偏移到最左侧

设备/浏览器

微信开发者工具,安卓手机

@jirentech jirentech changed the title [Bug Report] 请在此填写标题 [Bug Report] tab标签组件在使用动态数据时,第一个选中状态的下标线会偏移到最左侧 Dec 9, 2022
@landluck
Copy link
Contributor

landluck commented Dec 12, 2022

动态数据?怎么样使用动态数据,可以参考 https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html 提供代码片段协助定位问题

@jirentech
Copy link
Author

动态数据?怎么样使用动态数据,可以参考 https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html 提供代码片段协助定位问题

动态数据就是使用网络请求获取到的数据

@landluck
Copy link
Contributor

提供一个小程序代码片段吧,网络请求可以用 setTimeout 模拟

@forget1
Copy link

forget1 commented Jan 30, 2023

this.selectComponent('#xxx').resize()应该是可以暂时解决掉这个问题,之前用过这个方式

@jirentech
Copy link
Author

@landluck 小程序代码片段
https://developers.weixin.qq.com/s/eVv6XEmw7QFD

@landluck
Copy link
Contributor

问题已定位到,this.selectComponent('#xxx').resize() 可以临时解决,后续会修复

@landluck
Copy link
Contributor

@johnsonwong666

This was referenced May 18, 2023
@landluck
Copy link
Contributor

v1.10.19 版本已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants