当前位置:网站首页>Solution of vant tabbar blocking content
Solution of vant tabbar blocking content
2022-07-05 16:42:00 【Joy_ nine hundred and seventeen】
As we mentioned earlier , Use vant-tabbar To replace the native tabbar, But it is found in actual use , When tab After too much page content ,tabbar It will block the content at the bottom of the page
Directly above :
We will find that , Two buttons disappeared , from 2 Can be seen at , Right side of the screen scroll Over tabbar One column , The content is covered , It did slide to the bottom, but I couldn't see the button .
Why is this so ? Custom components of applets , It's through slot The content is injected into it and then rendered , and vant-tabbar Components are adopt cover-view In the form of Views overlaid on native components , It is not a reference component in the usual sense , Therefore, it is not a peer relationship with content elements .
At first I thought that since I was tabbar cover Live in an area , Then I'll find it tabbar Height of components , Then put the bottom element on top ?
Pictured above , Did find it ,vant The default is 50px, But the fixing effect is worrying , If you are interested, you can try . I guess it's because there is still a safe distance at the bottom of the component , So this height Not exactly equal to tabbar Occupation height of , Secondly, it will also be affected by the model .
During this period, I also tried another way , use scroll-view The label wraps the content , Then set a fixed height , such as 500px, In this way, the sliding content is not affected tabbar influence , Because the regions do not intersect . But it is also affected by the model .
Therefore, the final choice is to use the form of percentage to top up a distance , That is to say :
<view style="padding-bottom: 25%;"></view>
Look at the actual effect :
Most of the models tested are fairly ok. The disadvantage is that everyone has tabbar The page of , Need to add a blank view, Not very elegant . So I consider whether I can directly modify the custom components , stay slot Add directly before and after view, Or set it directly slot Style controls internal elements , But it didn't work , So stop .
Only try to jump to a new page and hide tabbar To avoid this . If you find a better way later , Updates will be synchronized , You are also welcome to tell me , thank ~
The full code is in github On , Ongoing update , welcome star Support :https://github.com/Joy917/signgo
边栏推荐
- 给自己打打气
- 利用GrayLog告警功能实现钉钉群机器人定时工作提醒
- 数据湖(十四):Spark与Iceberg整合查询操作
- 阿掌的怀念
- The new version of effect editor is online! 3D rendering, labeling, and animation, this time an editor is enough
- [deep learning] [original] let yolov6-0.1.0 support the txt reading dataset mode of yolov5
- [js] skill simplification if empty judgment
- APICloud云调试解决方案
- Cheer yourself up
- Solve cmakelist find_ Package cannot find Qt5, ECM cannot be found
猜你喜欢
新春限定丨“牛年忘烦”礼包等你来领~
Data Lake (XIV): spark and iceberg integrated query operation
Jarvis OJ 远程登录协议
养不起真猫,就用代码吸猫 -Unity 粒子实现画猫咪
【刷題篇】鹅廠文化衫問題
清晰还原31年前现场,火山引擎超清修复Beyond经典演唱会
Benji Bananas 会员通行证持有人第二季奖励活动更新一览
Hiengine: comparable to the local cloud native memory database engine
Global Data Center released DC brain system, enabling intelligent operation and management through science and technology
Jarvis OJ shell流量分析
随机推荐
Google Earth Engine(GEE)——Kernel核函数简单介绍以及灰度共生矩阵
Basic introduction to the control of the row component displaying its children in the horizontal array (tutorial includes source code)
Desci: is decentralized science the new trend of Web3.0?
Data verification before and after JSON to map -- custom UDF
[graduation season] as a sophomore majoring in planning, I have something to say
The memory of a Zhang
EDI许可证和ICP经营性证有什么区别
Today's sleep quality record 79 points
JSON转MAP前后数据校验 -- 自定义UDF
今日睡眠质量记录79分
《21天精通TypeScript-3》-安装搭建TypeScript开发环境.md
Raspberry pie 4B installation pytorch1.11
Cheer yourself up
[brush questions] effective Sudoku
【刷題篇】鹅廠文化衫問題
为季前卡牌游戏 MotoGP Ignition Champions 做好准备!
Sentinel-流量防卫兵
Binary tree related OJ problems
Can you help me see what the problem is? [ERROR] Could not execute SQL stateme
企业级备份软件Veritas NetBackup(NBU) 8.1.1服务端的安装部署