Commit 4bcfa1d5de87c2fa2e45b461276ac3d1c2b9162d

Authored by 梁灏
1 parent 93ea90c5

add file

Some old users use this file, so add agin
Showing 1 changed file with 21 additions and 0 deletions   Show diff stats
src/directives/clickoutside.js 0 → 100644
  1 +export default {
  2 + bind (el, binding, vnode) {
  3 + function documentHandler (e) {
  4 + if (el.contains(e.target)) {
  5 + return false;
  6 + }
  7 + if (binding.expression) {
  8 + binding.value(e);
  9 + }
  10 + }
  11 + el.__vueClickOutside__ = documentHandler;
  12 + document.addEventListener('click', documentHandler);
  13 + },
  14 + update () {
  15 +
  16 + },
  17 + unbind (el, binding) {
  18 + document.removeEventListener('click', el.__vueClickOutside__);
  19 + delete el.__vueClickOutside__;
  20 + }
  21 +};
0 22 \ No newline at end of file
... ...