vue3 watch immediate: true
时间: 2023-08-25 15:11:43 浏览: 146
在Vue 3中,使用`watch`来监听数据的变化。在`watch`中,可以通过设置`immediate: true`来在页面一开始加载时立即执行监听的回调函数。<em>1</em><em>2</em><em>3</em>
#### 引用[.reference_title]
- *1* *3* [Vue3的watch监听的多种情况](https://blog.csdn.net/m0_57482322/article/details/123157229)[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^v92^chatsearchT0_1"}} ] [.reference_item]
- *2* [vue3 watch监听 (immediate / deep / watchEffect)](https://blog.csdn.net/Frazier1995/article/details/127490928)[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^v92^chatsearchT0_1"}} ] [.reference_item]
[ .reference_list ]
阅读全文