Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

222
Views
How to use ref on <component> in vuejs?

I am having two independent VUE components and I want to communicate between them.

In the first component, I am using <component> and added ref to it.

<component ref="dynamicComponent"></component>

and in that above dynamic component, there is a method(suppose dynamicMethod) and I want to call that method from second component.

So for that, I am using below code:

this.$root.$refs.dynamicComponent.dynamicMethod();

But I am getting this.$root.$refs a blank object. How can I call that method.

Any help would be appreciated.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Make sure you're trying to access $refs only after the component is mounted. You should be able to access the $refs in the mounted hook.

mounted: function() {
  console.log(this.$refs);
},
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!