Questions tagged [vue-events]
85 questions
29
votes
6 answers
vuejs: @keyup.esc on div element is not working
I'm expecting that 'close' event is fired when I'm
clicking ESC button being on "shadow-modal" div, but it's not happening
vue 2.5.13, any ideas why?
…

DmitrySemenov
- 9,204
- 15
- 76
- 121
25
votes
1 answer
Why doesn't the '@drop' event work for me in vue?
The @drop listener doesn't work for me. It doesn't call the method I'm telling it to call.
I want to drag the chip and be able to drop it on another component, and perform a function, but at the time of dropping the chip, the dropLink method is not…

mk_xt
- 491
- 1
- 4
- 6
12
votes
2 answers
What does @input="$emit('input', $event)" means in vue component?
I am reading some code that I want to update:
what does @input="$emit('input', $event)" stand for?
Where and how can I listen for the input event?

Petran
- 7,677
- 22
- 65
- 104
6
votes
3 answers
How to fire an $emit event from Vue Composable
I have a vue composable that needs to fire an event. I naively set it up as follows:
*// composable.js*
import { defineEmits } from "vue";
export default function useComposable() {
// Vars
let buffer = [];
let lastKeyTime = Date.now();
…

Alan
- 1,067
- 1
- 23
- 37
6
votes
2 answers
Accessing paste event data with Vue
In a Vue app I have a paste listener on a textarea with the intention to run validation code when the user pastes data into this field. When I log the paste event I can see in the console that the data that was pasted into the field is there under…

jonas87
- 672
- 2
- 8
- 22
6
votes
1 answer
How to test a global event bus in VueJS
In this article it is explained how to use a global event bus in VueJS. It describes an alternative method to the common approach using an event bus defined in a separate file:
import Vue from 'vue';
const EventBus = new Vue();
export default…

cezar
- 11,616
- 6
- 48
- 84
6
votes
1 answer
How can I prevent click on drag?
I am trying to have an element with both a drag and click event. I have read about and tried a combination of event modifiers.
However, no matter what I try, I get a click when drag is stopped.
Note, in the MWE this is done on the component itself,…

SumNeuron
- 4,850
- 5
- 39
- 107
6
votes
1 answer
VueJs what is the difference between v-on:event and this.$on(event, handler)?
I'm learning about Vuejs event handling.
I think that the developer could use this.$on('event', handler) in js file to process the 'event'.
There is an example.
6
votes
1 answer
Vue stopPropagation not working - child to parent
I am struggling with events propagation. The task is to prevent clicking on anything alse, if the data is not saved. So, The left div contains a tree of options. After clicking on an item, a setting in the right div is showed. I want to warn the…

Peter Matisko
- 2,113
- 1
- 24
- 47
5
votes
1 answer
Vue.js: EventBus being called multiple times
I'm building the logic for an 'undo delete' - action. For that, I'm using an Event Bus to send an event to two unrelated components like so:
Undo.vue:
EventBus.$emit(`confirm-delete-${this.category}`, this.item.id);
The name of the…

suuuriam
- 687
- 12
- 24
5
votes
2 answers
v-on:change does not work for vue-multiselect
I am using vue-multiselect component in my vue.js project, I am using v-on directive to execute a function on the change event ,

Ciasto piekarz
- 7,853
- 18
- 101
- 197
5
votes
3 answers
VueJS: @click.native.stop = "" possible?
I have several nested components on the page with parents component having @click.native implementation. Therefore when I click on the area occupied by a child component (living inside parent), both click actions executed (parent and all nested…

DmitrySemenov
- 9,204
- 15
- 76
- 121
4
votes
1 answer
Vue.js, emit multiple parameters from child to parent
I am trying to emit multiple parameters from child to parents.What is the best way to do it.
Child
getUpdated(value, type) {
if (type === 'students') {
this.students = value.map(val => val.id);
}
…

user2410266
- 531
- 2
- 8
- 22
4
votes
3 answers
How to emit value as you type in Element UI Input v2.x?
This is my minimal working example, the following example uses version 2.x of element UI which we are currently using in this project.
https://codepen.io/peter-peter-the-typescripter/pen/WNGxWEB
{{ input }}

Denis Stephanov
- 4,563
- 24
- 78
- 174
4
votes
1 answer
Fire event when changing route with vue-router before DOM changes?
I'm quite new to Vue, hopefully this won't be a very stupid question :)
The beforeDestroy gets fired after the DOM structure changes.
I've tried using beforeUpdate and updated events, but none seems to fire before the DOM changes.
Reproduction…

Alvaro
- 40,778
- 30
- 164
- 336