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

472
Views
nuxtjs vuejs @error no se dispara en un componente cuando intenta cargar una imagen alternativa

Tengo un componente que alimento con accesorios.

Cuando una imagen arroja un 404, quiero cargar una imagen alternativa. Hasta aquí todo bien.

Sin embargo, la función @error nunca se activa cuando una imagen está rota y no puedo entender por qué. Nunca obtengo 'evento de hola' en la consola.

El componente está en el primer nivel de una página nuxt, mi configuración es un SPA estático.

Traté de implementarlo como se menciona al final de este problema de github: https://github.com/vuejs/vue/issues/5404

 <template> <div class="channel"> <div class="img"> <img :src="imgUrl" :alt="name" :title="name" @error="getFallBackImage" /> </div> </div> </template> <script> export default { data: function() { return { chanCover: this.cover } }, props: { name: { type: String, required: true }, cover: { type: String, required: true } }, computed: { imgUrl() { console.log(this.chanCover) return "channels/"+this.chanCover+".jpg" }, }, methods: { getFallBackImage(event) { console.log("hello event") this.chanCover = "default" } } } </script>
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!