devtools icon indicating copy to clipboard operation
devtools copied to clipboard

Vue 2.7 defineemits do not appear in Vue devtools

Open kirkwaiblinger opened this issue 3 years ago • 0 comments

Version

6.2.1

Browser and OS info

Chrome 105

Steps to reproduce

Create component with script setup, and defineemits type T = { (event: 'event', payload: string) } const emit = defineEmits<T>();

function handleClick(payload:string) { emit('event', payload); }

I attached this click handler to a div (@click="handleClick('payload')")

What is expected?

Vue dev tools Component Events should show event when div is clicked.

What is actually happening?

No event shown. Performance does show activity though (since I tested it where the function performs other work too).

Listeners, however, do receive the event.


when using an inline handler with @click="$emit('event', 'payload')", the event does appear in the devtools

(Context - I was trying to debug v-model, not realizing that Vue 2.7 requires v-bind.sync instead. So I was looking for the event which I thought should exist but it didn't show in dev tools)

kirkwaiblinger avatar Sep 20 '22 18:09 kirkwaiblinger