我的代码如下所示
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();
},
我得到的输出如下
为什么我得到不同的输出?