Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion for Vue 3.0 : let emit return a Promise array。 #113

Closed
LastHeaven opened this issue Jan 21, 2020 · 1 comment
Closed

Suggestion for Vue 3.0 : let emit return a Promise array。 #113

LastHeaven opened this issue Jan 21, 2020 · 1 comment

Comments

@LastHeaven
Copy link

What problem does this feature solve?

That can do something after emit event。

What does the proposed API look like?

const loading = ref(false)
const onClick = async () =>  {
 // doSomething
  loading.value = false
  // emit event
  await Promise.all(emit('click'))
  // doSomething
  loading.value = false
}
@posva
Copy link
Member

posva commented Jan 21, 2020

It seems it was implemented: vuejs/core#635

@posva posva closed this as completed Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants