Skip to content

The emits option in Mixins cant be inferred #13254

Open
@Hadakajime

Description

@Hadakajime

Vue version

3.5.13

Link to minimal reproduction

https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzgEwKYDNgDtUGELgQ5bwC+c6UBcARAG4CuqNA3AFBsDGRAzvCMAAe2OAF4UGbHgKRiMABQI2ASFQCYPAFyIVykAE8AonVQl5ASh3LrUVDAZQscGFCbtrpFZ9Ln2XXvD44ACMYhKYOEGypgpKylgAhiCo2jQACgm2JFFEMTQANCoCwlhacADausXYhcoAurXJMAAWEMhlcXrBFlbWLcA8AHQAJGrAMO7WAPRTcHMAegD8up7K3r4c3KWBMgBMYWgR0oRyiipjGtqdBsYxPZ3KtvaOzq6ok6ukjXat7VdV3UsD36Q1G6kmyhmczgSxWXjYPhYQA

Steps to reproduce

define a mixin that includes an emit

create a parent component that utilises the mixin, and includes a method that tries to emit the mixin's event

What is expected?

the emits defined in the mixin should be inferred in the parent component

(property) $emit: (event: "myEvent") => void

What is actually happening?

the available emits in the parent component do not present any of the mixin's emits

(property) $emit: (event: string, ...args: any[]) => void

System Info

Windows 11 with WSL to Ubuntu 24

Edition	Windows 11 Business
Version	24H2
Installed on	‎2025-‎02-‎24
OS build	26100.3775
Experience	Windows Feature Experience Pack 1000.26100.66.0

System:
    OS: Linux 5.15 Ubuntu 24.04.2 LTS 24.04.2 LTS (Noble Numbat)
    CPU: (16) x64 AMD Ryzen 7 7745HX with Radeon Graphics
    Memory: 27.47 GB / 31.19 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v22.12.0/bin/yarn
    npm: 10.9.0 - ~/.nvm/versions/node/v22.12.0/bin/npm
    pnpm: 10.6.3 - ~/.local/share/pnpm/pnpm

Any additional comments?

Similar to this ticket:

#13253

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions