Getting different output for same PROPS in vue.js

Published 7 months ago by afoysal

My code is like below

props: ['applicants',],
methods : {
   formated (item) {
       console.log('first')
       console.log(Object.keys(this.applicants).length)
   },
   fetchapplicants () {
       console.log('second')
       console.log(Object.keys(this.applicants).length)
   }
},
created () {
   EventBus.$on('change',this.formated);
},
beforeMount(){
   this.fetchapplicants();
},

I am getting output like below

enter image description here

Why I am getting different output ?

Please sign in or create an account to participate in this conversation.