[Vuejs]-[Vue warn]: Invalid handler for event "lazyLoadError": got undefined

-1👍

The methods that the template is looking for aren’t in the component definition for the template. They’re in the new Vue() instance you’re making inside of it:

<script>
  import Slick from 'vue-slick';

  export default {
    mounted() {
      this.News_list = JSON.parse(this.news)

      new Vue({
        // handleX methods are inside of here
      });
    },

    methods: {
      // they should be here
    }
  }
</script>

This is something proper formatting and indentation would have made more obvious. I’d suggest looking into a formatter like prettier.

Also, making a new Vue instance inside of a Vue component can lead to some really nasty side-effects and non-descript code. Your app should consist of only one new Vue at the top level, which uses all the rest of your components.

Leave a comment