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

114
Views
¿Cuál es la mejor manera de reutilizar algunos métodos entre dos componentes diferentes con AlpineJS?

Digamos que tengo dos componentes diferentes que comparten dos selecciones que reciben sus datos del servidor a través de un controlador:

 function component1() { return { someArray: [], someString: '', someBoolean: false, selectMethod1: function() { window.livewire.emit('get_select_method1'); }, selectMethod2: function(someParameter, anotherParameter) { window.livewire.emit('get_select_method2'); } } }

 function component2() { return { someInt: 1, selectMethod1: function() { window.livewire.emit('get_select_method1'); }, selectMethod2: function(someParameter, anotherParameter) { window.livewire.emit('get_select_method2'); } } }

En el ejemplo anterior, estoy buscando la mejor manera de reutilizar los métodos " selectMethod1 " y " selectMethod2 " en ambos componentes (sin la necesidad de crear un tercer elemento para las selecciones).

about 4 years ago · Juan Pablo Isaza
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!