Skip to content

Type interface improvement #553

Closed
Closed
@Mister-Hope

Description

@Mister-Hope

https://v3.vuejs.org/guide/component-custom-events.html#defining-custom-events

https://eslint.vuejs.org/rules/require-explicit-emits.html

TIP

It is recommended to define all emitted events in order to better document how a component should work.

Though it has no effects on Vue2, but we can still add emits: string[] | Record<string, null | ((emitData: any) => boolean) > in defineComponent for better documenting and to avoid eslint-plugin-vue@V7 throwing warnings.

Also, we have to warn people in readme that this has no effects and just for smoothing the miragation.


Adding emits options will broke ThisType in defineComponent now.

image

image

while eslint will throw warnings if using vue/require-explicit-emits

image

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