Skip to content

Events are not found in useAttrs #7630

Closed
@mrhammadasif

Description

@mrhammadasif

Vue version

3.2.45

Link to minimal reproduction

https://stackblitz.com/edit/vue-3-events-notinattrs?file=src%2FTest.vue

Steps to reproduce

According to the Vue 3 Migration Documentation https://v3-migration.vuejs.org/breaking-changes/listeners-removed.html#overview the $listeners is removed and we have to use useAttrs but useAttrs doesn't provide the events specified for the Component

<Test @dismiss="handler" />
const attrs = useAttrs()
attrs.onDismiss // ERROR: this is not found

What is expected?

To get events list as defined in https://v3-migration.vuejs.org/breaking-changes/listeners-removed.html#_3-x-syntax

What is actually happening?

Events are missing, only attributes are part of useAttrs

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 7.17.0 - /usr/local/bin/npm
  npmPackages:
    vue: ^3.2.25 => 3.2.31

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions