Questions tagged [vue-events]

85 questions
4
votes
1 answer

How could the Vue app pass the additional parameters to the event listener when using vm.$once()?

In the Vue app , it could add the event listener that is called one time by using vm.$once. For example, in the child component of Vue App, it could emit the event using vm.$emit('myEvent', data). emit event And then it could be processed by…
Andrew Li
  • 1,005
  • 12
  • 29
3
votes
2 answers

Conditionally add @submit.prevent to a form in Vue.js

I'm trying to conditionally prevent HTML form submission using @submit.prevent. I have a generic form model that looks like this (minimized a bit):
Jeremy L.
  • 853
  • 8
  • 15
3
votes
1 answer

v-model on custom Vue component not changing value on input

I'm trying to create a customCombobox component that works like a normal v-combobox with one addition - after user presses tab key, it will select the first option automatically (if there are any). What I've done so far looks good but v-model on…
Milano
  • 18,048
  • 37
  • 153
  • 353
3
votes
1 answer

How to get Vue to catch event?

Edited to correct unreported syntax error (see comments). It now works as desired. I'm having trouble getting my event handler to fire in the following Vue code. As you see, there are two components, posts and post, and a root Vue instance. The…
Tom Russell
  • 1,015
  • 2
  • 10
  • 29
2
votes
1 answer

Events not being received by parent component vue

Based on: https://forum.vuejs.org/t/passing-data-back-to-parent/1201 vue button related event not fired I have: https://codesandbox.io/s/vigilant-mendeleev-hi4br?file=/src/components/GenericItem.vue where the parent listens for events emitted by a…
Sebi
  • 4,262
  • 13
  • 60
  • 116
2
votes
0 answers

Vue JS Event bus data not working outside scope of event

I am using event bus to show alert on update data.so whenever user update the data i want to show an alert showing "Data is udpated" so for that i am using event bus here is BlogEdit.vue Component where i am firing event app.$router.push('/', () =>…
TP BIZ
  • 21
  • 4
2
votes
1 answer

How to use click event with Bootstrap-Vue in Vue.js?

How do I use the click event with the in Bootstrap-Vue shown below? I checked out the Vue.js documentation but I am not able to find any click event for .
Akash Patel
  • 156
  • 4
  • 15
2
votes
1 answer

How to get recurring component event to parent in Vue

So I have a Commentbox component that lists user comments (Comment) in a nested parent-child hierarchy using recursion. // Commentbox.vue (child) let's assume the data passed to…
Mueyiwa Moses Ikomi
  • 1,069
  • 2
  • 12
  • 26
2
votes
2 answers

VueJS $emit and $on not working in one component to another component page

I am trying to long time Vue $emit and $on functionality but still I am not getting any solution. I created simple message passing page its two pages only. One is Component Sender and Component Receiver and added eventbus for $emit and $on…
Ananth
  • 65
  • 3
  • 10
2
votes
0 answers

Listen for apply.daterangepicker event in vue component

I think I get how to listen for a click event, but I'm trying to determine how I listen for a custom event for the bootstrap-daterangepicker plugin. In jquery, you'd normally listen for this event with something like: …
hyphen
  • 2,368
  • 5
  • 28
  • 59
2
votes
2 answers

Nuxt Js Event Fires Twice

I am using Nuxt js SSR for an app that am build, I installed Vue Event plugin but when i emit an event it runs twice at the listener. Created hook runs twice too. Modules am using: Axios, Auth, Toast Child Component methods: { initPlaylist(songs)…
Mbengchan
  • 166
  • 3
  • 17
2
votes
3 answers

Vue,how to listen to same event from two child components inside parent?

Since I receive the same event and use the same event handler for both events , is there a way to listen to them in common , ie can…
Sainath S.R
  • 3,074
  • 9
  • 41
  • 72
2
votes
1 answer

vuejs component event with : not working

I have a vuejs component, inside one method of my components, I am dispatching an event like this: this.$emit('user:registerd', [user]) On the parent I try to capture it using But the above never…
hidar
  • 5,449
  • 15
  • 46
  • 70
1
vote
1 answer

Vue / Nuxt 3 Collapse component function from parent

I've created a reusable Collapse component using vue 3. It works as expected. The problem I have is I need to control 2 instances of the collapse from the parent / page. I was able to have the parent toggle a specific collapse using props but if I…
MonTOne
  • 19
  • 7
1
vote
1 answer

Listen on emitted events on component instance via this.$ref

Suppose we have a child component which emits a custom event iterated. Is there a way to listen to the event in the parent component via this.$ref? Like this.$refs.on('iterated', event). I know I can listen on component via v-on or by using watch,…
pixelmusik
  • 510
  • 5
  • 19