当前位置:网站首页>vant tabs组件选中第一个下划线位置异常
vant tabs组件选中第一个下划线位置异常
2022-07-02 09:38:00 【00008795】
错误图示例
产生场景:顶部标题是后台接口数据返回。vnat-tabs已经在data里面设置跳转到该页面是所选中状态active=0,数据出现后,下划线标签位置异常,在标题获取成功后再次设置active=0,无效果,但是有时偶现下划线数据正常。
原因分析:Tabs 组件在挂载时,会获取自身的宽度,并计算出底部条的位置。如果组件一开始处于隐藏状态,则获取到的宽度永远为 0,因此无法展示底部条位置。
问题解决:我使用了方法二


注意点:在获取标题数据完后调用selectComponent方法,不然重绘失效。
vant-tabs官方地址
边栏推荐
猜你喜欢

III Chip startup and clock system

念念不忘,必有回响 | 悬镜诚邀您参与OpenSCA用户有奖调研

二.Stm32f407芯片GPIO编程,寄存器操作,库函数操作和位段操作

ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘

从攻击面视角,看信创零信任方案实践

Importerror: impossible d'importer le nom « graph» de « graphviz»

Tick Data and Resampling

What are the software product management systems? Inventory of 12 best product management tools

PHP tea sales and shopping online store

Never forget, there will be echoes | hanging mirror sincerely invites you to participate in the opensca user award research
随机推荐
Tick Data and Resampling
mysql链表数据存储查询排序问题
Multi line display and single line display of tqdm
Webauthn - official development document
The first white paper on agile practice in Chinese enterprises was released | complete download is attached
sqlite 修改列类型
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
bedtools使用教程
QT learning diary 8 - resource file addition
Resources读取2d纹理 转换为png格式
Array splitting (regular thinking
微信小程序利用百度api达成植物识别
Gaode draws lines according to the track
TIPC addressing 2
Implementation of six singleton modes
Jenkins安装
ASTParser 解析含有emum 枚举方法的类文件的踩坑记
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
Openmldb meetup No.4 meeting minutes
A white hole formed by antineutrons produced by particle accelerators