this.$bus.$on('updateTodo', (oldValue, newValue) => {
console.log('oldValue, newValue', oldValue, newValue);
console.log('@@@@',this);
let c;
this.todoList.forEach((todo)=>{
if(todo.name == oldValue) c = todo;
});
c.name = newValue;
});
我在控制台打印查看,结果是箭头函数的this指向了this.$bus.$on中的this
在我以为,应该指向了this.$bus