vue中或箭头函数中,this的指向问题

首先,在Vue全部的生命周期钩子方法(如beforeCreate,created,beforeMount,mounted,beforeUpdate, updated,beforeDestroy以及destroyed)里使用this,this指向调用它的Vue实例,即(new Vue)。javascript 其次,箭头函数没有本身的this, 它的this是继承而来; 默认指向在定义它时所处的对象(
相关文章
相关标签/搜索