[Vuejs]-Vue ref call method from child component returns undefined method (v-for)

0👍

I got the loop working with this:

  this.$refs.userProfileComponent.forEach(i => i.functionInsideChildComponent());

if you want to use multiple statements or functions inside change it to:

this.$refs.userProfileComponent.forEach(i => {
i.functionInsideChildComponent();
console.log("hello");
});

Leave a comment