[Vuejs]-Show length of data array in VueJS after getting the data from API

3๐Ÿ‘

โœ…

Of course, created hook is triggered before mounted.
But you know, you are setting termine property using API response and it is happen with async.
If you simple set termine property with simple statement like this.termine = [โ€˜aโ€™, โ€˜bโ€™], it will logs 2.

If you want log the data after getting the value using API, you could use watch.
like:

watch: {
   termine(val) {
      console.log(val)
   }
}
๐Ÿ‘คplsdev89

Leave a comment