当前位置:网站首页>H5 van popup full screen pop-up window, simulates the page fallback effect, supports the return button in the upper left corner, and is suitable for physical return, side sliding and bottom return key
H5 van popup full screen pop-up window, simulates the page fallback effect, supports the return button in the upper left corner, and is suitable for physical return, side sliding and bottom return key
2022-06-10 20:34:00 【Half Annie】
First step :
1、 Definition animateDuration Variable
2、 Definition open Event execution method selectProjectOpenHandler
3、 Definition close Event execution method selectProjectCloseHandler
data () {
return {
animateDuration: 0.3 // Default pop-up animation time 0.3s
}
},
The second step :van-popup Use :
<!-- van-popup -->
<van-popup
v-model="_show"
position="right"
:overlay="false"
:style="{ width: '100%', height: '100%' }"
:duration="animateDuration"
@open="selectProjectOpenHandler"
@close="selectProjectCloseHandler">
<!-- Pop-up content -->
</van-popup>
The third step :
selectProjectOpenHandler:
// popup open
selectProjectOpenHandler () {
window.history.pushState(null, null, '#') // Simulate a new page history Record
window.addEventListener('popstate', this.popstateHandler) // add to popstate Event monitoring
}
popstateHandler (e) {
this.animateDuration = 0 // Prevent side slip from animating many times
this._show = false // close van-popup
}
selectProjectCloseHandler:
// popup close
selectProjectCloseHandler () {
window.removeEventListener('popstate', this.popstateHandler, false)
},
Step four : Button returns the method goBack ( important !)
goBack () {
window.history.back() // Delete van-popup Added when opening history
this._show = false
},
The bar effect !!! Specific business needs can be adjusted by themselves
边栏推荐
- 割舍绳子/整数分割
- 为什么网页样式属性,有的需要加冒号“:”,有的不用?
- Solution to the problem that JLINK CDC UART driver cannot be installed normally under win7 system
- 中衍期货靠谱吗?是不是正规期货公司?开户安全吗?
- Mysql database foundation
- 批量检测不同url的指定端口(py脚本)
- 高通 QC2.0 快速充电智能识别IC FP6719
- FS4100 锂电充电管理IC输入12V给8.4V充电IC
- Microsoft Word tutorial "5", how to change the margins and create a newsletter column in word?
- 【录入课本latex记录】
猜你喜欢
![[enter textbook latex record]](/img/f0/5ca60f0894d4ae544e7399d18a3a42.png)
[enter textbook latex record]

京东发布基于张量网络加速的大规模、分布式量子机器学习平台TeD-Q

First batch! Sinomenine has passed CWPP capability assessment and inspection of Xintong Institute

canvas 高级功能(中)

Microsoft Word 教程「5」,如何在 Word 中更改页边距、创建新闻稿栏?

Microsoft Word 教程「5」,如何在 Word 中更改頁邊距、創建新聞稿欄?

Hm3416h buck IC chip pwm/pfm controls DC-DC buck converter

How to realize face verification quickly and accurately?

I drew several exquisite charts with plotly, which turned out to be beautiful!!
![[FAQ] summary of common problems and solutions during the use of rest API interface of sports health service](/img/9e/9ce804d84fb8ec9221b7c10bbd6c36.jpg)
[FAQ] summary of common problems and solutions during the use of rest API interface of sports health service
随机推荐
中国工科研究生200多篇英文论文中最常见的习惯(The Most Common Habits from more than 200 English Papers written by Gradua)
C语言 浮点数 储存形式
江波龙 FORESEE XP2000 PCIe 4.0 SSD 多重加密功能,锁定数据安全
国家先进计算产业创新(宜昌)中心正式落地 中科曙光、升哲科技联合运营
I drew several exquisite charts with plotly, which turned out to be beautiful!!
Is it safe to open a futures account online? How to avoid being cheated?
在阿里云国际上使用 OSS 和 CDN 部署静态网站
torch.nn.Parameter的简单理解//未完待续,待我看懂这段
暗黑破坏神不朽WIKI地址 暗黑破坏神不朽数据库地址分享
Solution to the problem that JLINK CDC UART driver cannot be installed normally under win7 system
8.4v dual lithium battery professional charging IC (fs4062a)
补水仪108K加湿器开发方案_单片机_NY8A051F_单片机开发设计开发
RuntimeError: Attempting to deserialize object on CUDA device 1 but torch.cuda.device_count() is 1.
Key points of lldp protocol preparation
传音 Infinix 新机现身谷歌产品库,TECNO CAMON 19 预装 Android 13
Fs4060a is a 4.2v/3a charging IC
Hm3416h buck IC chip pwm/pfm controls DC-DC buck converter
Microsoft Word 教程「5」,如何在 Word 中更改頁邊距、創建新聞稿欄?
PDU会话流程
搭建一个BPMN建模的Web服务