Closed Arturexe closed 11 months ago
I've removed the @update:
event-prefixes and now the vtsc
succeeds:
<product-settings-tab
v-else
:customer="customer"
:productsTab="productsTab"
:showAllBusinessCases="state.showAllBusinessCases"
:priceSetting="state.priceSetting"
:customerClients="state.customerClients"
@showAllBusinessCases="emit('update:showAllBusinessCases', $event)"
@priceSetting="emit('update:priceSetting', $event)"
@customerClients="emit('update:customerClients', $event)" />
Edit: This however leads to other issues with how the event is handled. It seems to be broken.
const emitShowAllBusinessCases = (event: boolean): void => { emit('update:showAllBusinessCases', event) }
just before emit, can you log event and share it again ?
@Arturexe priceSetting
and customerClients
's second argument cannot include undefined
, but you did pass undefined
.
const emit = defineEmits<{
(e: 'update:customerClients', customerClients: KeyValue[] /* note this */): void
}>()
const emitCustomerClients = (event: KeyValue[] | undefined /* note this */): void => {
emit('update:customerClients', event)
}
(though the error message is a little bit weird)
Vue version
3.3.4
Link to minimal reproduction
-
Steps to reproduce
i have no idea, create multiple emits?
What is expected?
vtsc
should not fail.What is actually happening?
I'm running
vtsc
on this vue component:but these errors are thrown:
It seems that
vtsc
is confusing the events declared inemit
. I've already move the emits out of inline-events but it didn't help.[11:29:55 AM] Found 2 errors. Watching for file changes.
System Info
Any additional comments?
No response