vue 页面渲染回调
时间: 2023-10-07 21:04:29 浏览: 113
在使用Vue.js框架时,可以使用Vue.nextTick(callback)或Vue.$nextTick(callback)来实现页面渲染回调功能。当数据发生变化,更新后执行回调的是Vue.nextTick(callback),而当DOM发生变化,更新后执行回调的是Vue.$nextTick(callback)。这两个方法可以在页面渲染完成之后执行指定的函数方法,用于处理初始化相关的操作。例如,在页面加载一个数据列表完成之后,可以使用Vue.nextTick(callback)或Vue.$nextTick(callback)来计算列表高度并控制定位到指定行。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [vue页面渲染结束事件](https://blog.csdn.net/qq_42155199/article/details/121517076)[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_1"}}] [.reference_item style="max-width: 50%"]
- *2* [vue2.0$nextTick监听数据渲染完成之后的回调函数方法](https://download.csdn.net/download/weixin_38643212/14826005)[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_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文