Skip to content
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

9.1 事件系统 #3

Closed
RubyLouvre opened this issue Apr 21, 2017 · 0 comments
Closed

9.1 事件系统 #3

RubyLouvre opened this issue Apr 21, 2017 · 0 comments

Comments

@RubyLouvre
Copy link
Owner

for (var i = paths.length; i--;) { //从上到下
          var path = paths[i]
          var fn = path.props[captured]
          if (typeof fn === 'function') {
              event.currentTarget = path.dom
              fn.call(path.dom, event)
              if (event._stopPropagation) {
                  break
              }
          }
      }

      for (var i = 0, n = paths.length; i < n; i++) { //从下到上
          var path = paths[i]
          var fn = path.props[bubble]
          if (typeof fn === 'function') {
              event.currentTarget = path.dom
              fn.call(path.dom, event)
              if (event._stopPropagation) {
                  break
              }

          }
      }

event应该改成e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant