/**
 * v-clickoutside
 * @desc 点击元素外面才会触发的事件
 * @example
 * ```vue
 * <div v-element-clickoutside="handleClose">
 * ```
 */
let handler;

export default {
  bind(el, binding, vnode) {
    const expression = binding.expression;
    handler = function(e) {
      if (vnode.context && !el.contains(e.target)) {
        vnode.context[expression]();
      }
    };
    document.addEventListener('click', handler);
  },

  unbind() {
    document.removeEventListener('click', handler);
  },

  install(Vue) {
    Vue.directive('clickoutside', {
      bind: this.bind,
      unbind: this.unbind
    });
  }
};

@@ -121,19 +121,59 @@
  */%0A
-let handler
+const clickoutsideContext = '@@clickoutsideContext'
 ;%0A%0Ae
@@ -231,46 +231,17 @@
 nst 
-expression = binding.expression;%0A    h
+documentH
 andl
@@ -339,29 +339,152 @@
 xt%5Be
-xpression%5D();%0A      %7D
+l%5BclickoutsideContext%5D.methodName%5D();%0A      %7D%0A    %7D;%0A    el%5BclickoutsideContext%5D = %7B%0A      documentHandler,%0A      methodName: binding.expression
 %0A   
@@ -518,33 +518,41 @@
 stener('click', 
-h
+documentH
 andler);%0A  %7D,%0A%0A 
@@ -550,16 +550,107 @@
 ;%0A  %7D,%0A%0A
+  update(el, binding) %7B%0A    el%5BclickoutsideContext%5D.methodName = binding.expression;%0A  %7D,%0A%0A
   unbind
@@ -650,16 +650,18 @@
  unbind(
+el
 ) %7B%0A    
@@ -698,17 +698,49 @@
 click', 
-h
+el%5BclickoutsideContext%5D.documentH
 andler);

fix error unbind, and add update method