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

175
Views
difference between this.$root.$on and this.$root.$emit

I don't understand when should this be used this.$root.$on('text', this.method);}, and what is meant by $root and $on

also its difference with this.$root.$emit isn't clear for me

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

0

$root is your vue app. $on are your event listeners. $emit is the event emitter method

so if you define this.$root.$on('foo' (arg)=>console.log(arg)) and then emit this.$root.$emit('foo', 'emitted event foo')

console will print emitted event foo

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!