uni-app组件生命周期
时间: 2023-09-08 14:07:16 浏览: 148
uni-app 组件里面获取元素宽高的实现
uni-app组件的生命周期包括以下几个阶段:created、attached、ready、moved和detached。当组件实例被创建时,created函数会被调用;当组件被添加到页面节点树中时,attached函数会被调用;当组件渲染完毕并且可以和页面交互时,ready函数会被调用;当组件被移动到新的位置时,moved函数会被调用;当组件被从页面节点树中移除时,detached函数会被调用。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [uniapp中的生命周期](https://blog.csdn.net/jieyucx/article/details/130082445)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [uniapp 生命周期简介](https://blog.csdn.net/BlizzardWu/article/details/112862047)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文