-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My Story / 我的故事 #11
Labels
Comments
很高兴,其实我一直也会这么写,并且会为actionList里的每一个属性(action)重新指定上下文及event; actionList[actionName] && actionList[actionName].call(this,event); 好处是: 请问有没有更好的方式解决这个问题?比如trigger的时候自动绑定正确的上下文? |
个人觉得Backbone里面的event map也比较方便 events: {
'click [data-action="my-action"]': 'doMyAction'
} 而且上下文是自动绑定 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Video / 视频
Slides / 幻灯片
// BACKGROUND
// TRACKING?
// BUT...
// "USE JQUERY, YOU IDIOT!"
// WHAT A MESS...
// EVENT DELEGATION?
// WHAT IF MORE AND MORE BTNS?
// NEED TO IMPROVE THIS!
// GROUP ALL THESE EVENT DELEGATION?
// `ID`?
// WHY NOT HTML5 DATASET?
// WAIT, CLASS NAMES ARE UNNECESSARY!
// NO UGLY 'switch'!
// DEFINE MORE ACTION LATER?
// USE CASE: CMUI
// NO EVENT-BINDING CODE NEEDED!
The text was updated successfully, but these errors were encountered: