vue中箭头函数的使用

一.箭头函数和普通函数的区别: 1.普通函数中的this: 代表它的直接调用者(js的this是执行上下文), 例如 obj.cal() ,那么cal()方法中的this就是obj 若没找到直接调用者,则this指的是 window (常见的window的属性和方法有: alert, location,document,parseInt,setTimeout,setInterval等)或者 und
相关文章
相关标签/搜索