Просмотр исходного кода

add e.targetEl to account for e.currentTarget

Evan You 12 лет назад
Родитель
Сommit
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)
             }