摘要:
Vue2中,可以通过this来获取当前组件实例; Vue3中,在setup中无法通过this获取组件实例,console.log(this)打印出来的值是undefined。 在Vue3中,getCurrentInstance()可以用来获取当前组件实例 vue3官方文档解释 let { proxy 阅读全文
posted @ 2024-02-21 08:37 且行且思 阅读(8433) 评论(0) 推荐(0)
|
|||
|
摘要:
Vue2中,可以通过this来获取当前组件实例; Vue3中,在setup中无法通过this获取组件实例,console.log(this)打印出来的值是undefined。 在Vue3中,getCurrentInstance()可以用来获取当前组件实例 vue3官方文档解释 let { proxy 阅读全文
posted @ 2024-02-21 08:37 且行且思 阅读(8433) 评论(0) 推荐(0) |
|||