Vue3无法在父组件中调用子组件方法
在Vue2中,我可以像这样调用子组件方法
this.$root.$refs.ChildComponent.methodName()
Run Code Online (Sandbox Code Playgroud)
但是在Vue3中,我收到这样的错误
runtime-core.esm-bundler.js:218 Uncaught TypeError: Cannot read properties of undefined (reading 'methodName')
Run Code Online (Sandbox Code Playgroud) vuejs3 ×1