We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 289d967 commit bfc4517Copy full SHA for bfc4517
index.js
@@ -13,9 +13,11 @@ if (!compatible) {
13
14
var HANDLER = '_vue_clickaway_handler';
15
16
-function bind(el, binding) {
+function bind(el, binding, vnode) {
17
unbind(el);
18
19
+ var vm = vnode.context;
20
+
21
var callback = binding.value;
22
if (typeof callback !== 'function') {
23
if (process.env.NODE_ENV !== 'production') {
@@ -48,7 +50,7 @@ function bind(el, binding) {
48
50
// @NOTE: `.path` is non-standard, the standard way is `.composedPath()`
49
51
var path = ev.path || (ev.composedPath ? ev.composedPath() : undefined);
52
if (initialMacrotaskEnded && (path ? path.indexOf(el) < 0 : !el.contains(ev.target))) {
- return callback(ev);
53
+ return callback.call(vm, ev);
54
}
55
};
56
0 commit comments