Преглед изворни кода

add e.targetEl to account for e.currentTarget

Evan You пре 12 година
родитељ
комит
96541d5608
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      src/directives/on.js

+ 3 - 1
src/directives/on.js

@@ -19,10 +19,12 @@ module.exports = {
             utils.warn('Directive "on" expects a function value.')
             return
         }
-        var targetVM = this.vm,
+        var el       = this.el,
+            targetVM = this.vm,
             ownerVM  = this.binding.compiler.vm,
             isExp    = this.binding.isExp,
             newHandler = function (e) {
+                e.targetEl = el
                 e.targetVM = targetVM
                 handler.call(isExp ? targetVM : ownerVM, e)
             }