[Vuejs]-Vue Canvas not loading images

0👍

This fix for this was adding a v-on:load="numOfLoadedImgs++" even handler and a data point called numOfLoadedImgs: 0

When all images finish loaded the count will be 6 and I have a watch method that then loads the canvas when the number is equal to 6

<img v-on:load="numOfLoadedImgs++" id="torso" src="" style="display:none;" alt="">

  data(){
    return{
     numOfLoadedImgs: 0

    }
  },
  watch:{
    numOfLoadedImgs(num){
      if(num === 6){
        this.loadCanvas();
        return num
      }
      return num
    }
  },
  methods:{
    loadCanvas(){}
  }

Leave a comment