question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vue components should emit events

See original GitHub issue

The Uppy Vue components should emit events. eg:

<drag-drop :uppy="uppy" @files-added="filesAdded" />

I would expect the appropriate result of the files-added event to also be passed to the event handler.

Currently, the only way to listen to events is directly on the uppy instance. This has required me to work around it by building a wrapper component to emit these events.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
michaeltoohigcommented, Oct 17, 2021

@duerrsimon thanks for the example. I was looking for how to catch the event dashboard:modal-closed and got it to work as follows.

computed: {
    uppy() {
      return new Uppy().use(XHRUpload, {
        endpoint: `http://localhost:8000/api/v1/images`,
        headers: {
          authorization: `Bearer ${this.token}`,
        },
      }).on('dashboard:modal-closed', () => {
        console.log('Do something when modal closes.');
      });
    },
  },
0reactions
stale[bot]commented, Oct 18, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Component Events | Vue.js
A component can emit custom events directly in template expressions (e.g. in a v-on ... Unlike native DOM events, component emitted events do...
Read more >
A Guide to Vue $emit - How to Emit Custom Events in Vue
When we emit an event, we invoke a method with one or more arguments: ... Then, using the v-on or @ directive, a...
Read more >
What is Vue Emit? - JavaScript Works
Vue $emit is a function that lets us emit, or send, custom events from a child component to its parent. In a standard...
Read more >
A Guide on How to use Emit in Vue - Fjolt
In Vue we use emit to send data from a child component to its parent via events. Let's look at how it works....
Read more >
Emit function in Vue.js - Yahya Gok - Medium
generally, emit function notifies parent component that something has changed in child component. I will deep into emit function with an example ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found