当前位置:网站首页>Uni app advanced life cycle
Uni app advanced life cycle
2022-07-28 10:13:00 【Hua Weiyun】
uni-app Advanced lifecycle

Uni app The following application lifecycle features are supported :
Pay attention to the :
Ontabitemtap Usually used to click the current tab item to scroll or refresh the current page . If you click another tab item , Page switching will be triggered .
If you want to click an application side tab item without jumping to the page , Cannot be used ontabitemtap. You can use plus nativeObj. The view places a block over the original tab item , And intercept the click event .
Alipay applet platform ontabitemtap Triggered after clicking a non current tab item , So it cannot be used to click back to the top
onTabItemTap : function(e) { console.log(e); // e The return format of is json object : {"index":0,"text":" home page ","pagePath":"pages/index/index"}},1、uni app framework The life cycle of Vue And wechat applet Life cycle of
2、Onlaunch Used in global applications to indicate when the application starts
3、 Used on the page onload or Onshow Indicates when the page is loaded and when the page is displayed
4、 When installing components installed in components
app.vue:
onLaunch: function() { console.log('App Launch App launch ') }, In fact, it's just typing “ App launch ” Four words , The app was triggered
then , At run time , You can see that... Is displayed first “ Application startup ”, Then show “ Page loading complete ”
This is still the case . The second life cycle of the experiment Onshow It's still the same
But in the third experiment , We can try to install the lifecycle on the plug-in , We will find that it can run successfully
<script> export default { onLoad(){ console.log("my-form onLoad"); }, mounted() { console.log("myform mounted"); } }</script>Page cycle
1.onload( Listen for page loading )
2.onshow( Monitor page display )
3.onready( Complete the first rendering of the listening page )
4.onhide( Hide listening page )
5.onunload: Unload the listening page
6.onresize: Monitor window size changes
7.onpulldownrefresh: Listen for user drop-down actions . Usually used for pull-down refresh
onBackPress Callback parameter object :
export default { data() { return {}; }, onBackPress(options) { console.log('from:' + options.from) }}边栏推荐
- On July 13, 2021, we collapsed like this
- Cloudcompare & PCL matching point sampling consistency suppression
- 2021.07.13 我们是这样崩的
- 线程同步volatile与synchronized详解
- OSPF的拓展配置,选路原则,防环及重发布
- Skiasharp's WPF self drawn drag ball (case version)
- LinkedList源码按摩,啊舒服
- QT | some summaries of signals and slots
- LinkedList source massage, ah comfortable
- Double pointer technique
猜你喜欢
随机推荐
Skillfully use NGX_ Lua makes traffic grouping
基于docker安装MySQL
Uni app advanced creation component / native rendering
Redis面试题必知必会
医药行业数字化建设,箭在弦上
Leetcode076 -- the kth largest number in the array
In the era of home health diagnosis, Senzo creates enhanced lateral flow test products
[openharmony] [rk2206] build openharmony compiler (2)
Consul
银行入职考试要点汇总
19. 删除链表的倒数第 N 个结点
Consul
Introduction to timebasedrollingpolicy
_HUGE and __IMP__HUGE in “math.h“
Openatom openharmony sub forum, see you today at 14:00! Wonderful release of memorabilia attached
Weekly report on July 27, 2022
深度学习必懂的 13 种概率分布
API 网关 APISIX 在Google Cloud T2A 和 T2D 的性能测试
双指针技巧
Tencent technical experts: decrypt the 100 million user products wechat, QQ, King glory... Comprehensively practice on the cloud!









