Modify the directory structure
Modify the directory structure
This commit is contained in:
parent
31fbef10e4
commit
4b05d84ea2
175 changed files with 48 additions and 46 deletions
19
src/directives/clickoutside.js
Normal file
19
src/directives/clickoutside.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
export default {
|
||||
bind () {
|
||||
this.documentHandler = (e) => {
|
||||
if (this.el.contains(e.target)) {
|
||||
return false;
|
||||
}
|
||||
if (this.expression) {
|
||||
this.vm[this.expression]();
|
||||
}
|
||||
};
|
||||
document.addEventListener('click', this.documentHandler);
|
||||
},
|
||||
update () {
|
||||
|
||||
},
|
||||
unbind () {
|
||||
document.removeEventListener('click', this.documentHandler);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue