vue.js 如何获取某个组件实例?

2025-04-14 00:36:49
推荐回答(1个)
回答(1):

如果是在父附件中,可以通过ref

在父组件中 this.$refs.ref1

在子组件中通过 this.$parent获取父组件