Cathy cfc7ad6282 TODOS(JQuery+Node+Mongo数据库) | il y a 4 ans | |
---|---|---|
.. | ||
model | il y a 4 ans | |
public | il y a 4 ans | |
router | il y a 4 ans | |
app.js | il y a 4 ans | |
package-lock.json | il y a 4 ans | |
package.json | il y a 4 ans | |
readme.md | il y a 4 ans |
这样写的话this指向的是触发事件元素本身 taskBox.on('click', '.destroy', function () {
console.log(this);
)};
这样写的话this指向的Window, 因为箭头函数不改变this指向 taskBox.on('click', '.destroy', () => {
console.log(this);
)};