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

297
Views
El reloj Vue 2 falla para mezclar la propiedad de datos, pero funciona si el componente tiene la propiedad de datos

Estoy tratando de mover alguna funcionalidad a un vue mixin del componente, para poder usarla en múltiples componentes.

Esta (versión simplificada del código) funciona:

 export default { data() { return { file: {}, audioPlayer: { sourceFile: null, }, }; }, watch: { 'audioPlayer.SourceFile': function (nextFile) { console.log('new sourceFile'); this.$data.file = nextFile; }, } }

Pero si muevo el objeto de datos del reproductor de audio a una mezcla, el reloj ya no se dispara.

¿Es este el comportamiento esperado?

Nb, resolví esto al convertir directamente la propiedad de datos 'archivo' en un valor calculado, lo que funciona en este caso particular, pero el comportamiento sigue siendo extraño.

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

0

Necesitas una s minúscula. archivo sourceFile no SourceFile

 watch: { 'audioPlayer.sourceFile': function (nextFile) { console.log('new sourceFile'); this.$data.file = nextFile; }, }
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!