当前位置:网站首页>Combined use of vant popup+ other components and pit avoidance Guide
Combined use of vant popup+ other components and pit avoidance Guide
2022-07-05 16:42:00 【Joy_ nine hundred and seventeen】
Do small program development , I believe you are no stranger to form collection . But we often encounter some slightly more complex options , It's not simply filling in some words , Numbers , Or choose whether it can be done . Interactive judgment may be required , Or it can be well displayed in combination with other custom components , But such components often take up a lot of space , If you put all your thoughts on the list , The page will appear very crowded .
So how to solve this problem ? Common ways are ,popup Pop-up layer 、 Jump to a new page and so on .
Among them, the loading jam and discontinuity of jump pages will affect the user experience , Unless it is a single multiple collection page , There is a lot of information, so let's say .
So in practical application ,popup Pop up layers are the most common , The way to solve the problem that components occupy the screen . First, let's take a look at the demonstration :

This is a typical popup + treeSelect Combination of components , Yes, of course , there treeSelect Can be replaced by timePicker Or other components . When you think that opening a new page is shooting mosquitoes , This way can be used when it is not open and crowded , Smooth and space saving .
It's easy to use , Just nest tags :
<van-popup show="{
{ showTree }}" round position="bottom" custom-style="height: 50%" bind:close="onCloseTreeSelect">
<van-tree-select items="{
{ items }}" main-active-index="{
{ mainActiveIndex }}" active-id="{
{ activeId }}" bind:click-nav="onClickNav" bind:click-item="onClickItem" />
</van-popup>
Be careful : There's a big hole here ,vant Official documents default popup attribute close-on-click-overlay—— Whether to close after clicking the mask layer , The default is true, But if you don't realize bind:close Method words , Clicking on the mask layer will not close the pop-up layer
in addition , For components with cancellation or confirmation , If and popup When combined , Recommended coverage popup Of close Button , Otherwise, it will be messy .
The full code is in github On , Ongoing update , Welcome to support :https://github.com/Joy917/signgo
边栏推荐
猜你喜欢

Data Lake (XIV): spark and iceberg integrated query operation

Summary of methods for finding intersection of ordered linked list sets

ES6 drill down - Async functions and symbol types

【深度学习】深度学习如何影响运筹学?

Accès aux données - intégration du cadre d'entité

《21天精通TypeScript-3》-安装搭建TypeScript开发环境.md

Desci: is decentralized science the new trend of Web3.0?

scratch五彩糖葫芦 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月

PSPNet | 语义分割及场景分析

The database of the server is not connected to 200310060 "unknown error" [the service is up, the firewall is off, the port is on, and the netlent port is not connected]
随机推荐
The database of the server is not connected to 200310060 "unknown error" [the service is up, the firewall is off, the port is on, and the netlent port is not connected]
【刷題篇】鹅廠文化衫問題
不敢买的思考
BS-XX-042 基于SSM实现人事管理系统
解决CMakeList find_package找不到Qt5,找不到ECM
PHP strict mode
yarn 常用命令
Fleet tutorial 09 basic introduction to navigationrail (tutorial includes source code)
sqlserver 做cdc 要对数据库性能有什么要求么
[team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details
Today's sleep quality record 79 points
《MongoDB入门教程》第04篇 MongoDB客户端
Jarvis OJ Flag
Sentinel flow guard
Migrate /home partition
Enter a command with the keyboard
面对新的挑战,成为更好的自己--进击的技术er
APICloud云调试解决方案
Intel 13th generation Raptor Lake processor information exposure: more cores, larger cache
新春限定丨“牛年忘烦”礼包等你来领~