Skip to content

@update:modelValue resolves correctly, whereas @update:model-value is any #3900

@DamianGlowala

Description

@DamianGlowala

I am using a Vue component with a simple two-way data binding:

const modelValue = defineModel<string>({ required: true })

When I use the component and declare an event listener on it (@update:model-value), the type is any. Tried changing it to @update:modelValue and, surprisingly, it works!

There's a https://eslint.vuejs.org/rules/v-on-event-hyphenation.html rule which warns about the correctly resolved variant, hence I would much rather keep the hyphenated convention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions