When sending reaction, redact if already send

This commit is contained in:
N Pex 2023-02-08 14:02:08 +00:00 committed by n8fr8
parent 749c144c78
commit 0af573ccfc
3 changed files with 46 additions and 6 deletions

View file

@ -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);
};
});