When sending reaction, redact if already send
This commit is contained in:
parent
749c144c78
commit
0af573ccfc
3 changed files with 46 additions and 6 deletions
12
src/main.js
12
src/main.js
|
|
@ -36,10 +36,18 @@ Vue.use((Vue) => {
|
|||
Vue.prototype.$bubble = function $bubble(eventName, ...args) {
|
||||
// Emit the event on all parent components
|
||||
let component = this;
|
||||
let arg = args.at(0);
|
||||
let stop = false;
|
||||
if (arg) {
|
||||
// Add a "stopPropagation" function so that we can do v-on:<eventname>.stop="..."
|
||||
arg.stopPropagation = () => {
|
||||
stop = true;
|
||||
}
|
||||
}
|
||||
do {
|
||||
component.$emit(eventName, ...args);
|
||||
component.$emit(eventName, ... args);
|
||||
component = component.$parent;
|
||||
} while (component);
|
||||
} while (!stop && component);
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue