File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -77,18 +77,18 @@ Vue.directive('clickoutside', {
77
77
const handler = binding .value
78
78
79
79
// create a named function for the handler
80
- function handler (event ) {
80
+ function wrappedHandler (event ) {
81
81
const target = event .target
82
82
if (! el .contains (target) && el !== target) {
83
83
handler (event )
84
84
}
85
85
}
86
86
87
87
// and save it in a property on the element
88
- el .__vueClickOutside__ = handler
88
+ el .__vueClickOutside__ = wrappedHandler
89
89
90
90
setTimeout (function () {
91
- document .addEventListener (' click' , handler )
91
+ document .addEventListener (' click' , wrappedHandler )
92
92
}, 0 )
93
93
},
94
94
@@ -117,8 +117,8 @@ var handlerCache = new Map()
117
117
Vue .directive (' clickoutside' , {
118
118
bind (el , binding ) {
119
119
// ...
120
- // el.__vueClickOutside__ = handler
121
- handlerCache .set (el, handler )
120
+ // el.__vueClickOutside__ = wrappedHandler
121
+ handlerCache .set (el, wrappedHandler )
122
122
// ...
123
123
},
124
124
unbind (el ) {
You can’t perform that action at this time.
0 commit comments