How to get return value from this.$emit?

for example:

    <some-component @someevent="getEvent"></some-component>
    // here i`m drink a coffe and say...
    return true

somewhere in some-component

  let v = this.$emit('someevent',payload)

may i hope someday v will be true instead this?

Although I don’t quite understand what you mean, you can refer to the examples and adapt it to the result you want.



    parentMethod(who) {
      alert(`Hi, ${who}`)

just does some work, and I would like him to return the result of this work, for example

    parentMethod(who) {
      return confirm(`Hi, ${who}, are you sure?`)

And to get the result of this work in the component

answer = this.$emit('child-event', 'every one')

And i look into source code and i see - that impossible, because one event may have many handlers

If you want to get return value from parentMethod, you can try it. :slightly_smiling_face:

Although this is strange, it works.
By the way, $emit just emit a callback,
shouldn’t have been used this way

too complicated)))
easier to make my own option of $emit
or make your solve easier without promises