[Vuejs]-Accessing emitted event's data inside the inline handler in Vue.js

0πŸ‘

βœ…

$event isn’t actually a wrapper, but the data you’re sending over.

So you can handle it as follows:

template: `
    <div>
        <some-component @select="selected = $event"></some-component>
    </div>
`,
data: () => ({
    selected: undefined
})

Leave a comment