vue3 inject
时间: 2023-09-02 15:11:21 浏览: 97
Vue3中的inject是一种在组件之间进行跨层级通信的方法。通过在父组件中使用provide提供数据,然后在子组件中使用inject注入并获取这些数据。这种方式可以方便地实现组件之间的数据传递,而无需通过props逐层传递。。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [vue 3 学习笔记 (八)——provide 和 inject 用法及原理](https://blog.csdn.net/weixin_43880397/article/details/121552232)[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* [Vue3 理解 provide / inject 的作用、使用](https://blog.csdn.net/cookcyq__/article/details/121619003)[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 ]
阅读全文