e.target.dataset与e.currentTarget.dataset检查前端是否有错误 是否传入值或者是否 调用某个js页面 arlert()或者 console.log(action);

https://blog.csdn.net/jingjingshizhu/article/details/80067566
e.target.dataset与e.currentTarget.dataset获取不到定义的值

GetAction: function (e) {
    var action = e.currentTarget.dataset.action;
    console.log(action); //father
}
GetAction: function (e) {
    var action = e.target.dataset.action;
    console.log(action); //undefined
}

猜你喜欢

转载自blog.csdn.net/qq_42664961/article/details/86549085