Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Question] How to use emits in component ? #204

Copy link
Copy link
Open
@ariran5

Description

@ariran5
Issue body actions

How to use components events with jsx ?

I use component with emits, and if i use this component in jsx then i can't add listener

// ModalMini.vue
...

  emits: ['change', 'leave'],
  setup(props, ctx){
    const {
      emit,
      slots,
    } = ctx
    emit('change', 123)
  ...
  }
...
// page.vue
...
<ModalMini
  class="ModalAnalitycs"
  onChange={changeShow}
>
...

onChange on ModalMini not work

TS says

Property 'onChange' does not exist on type 'IntrinsicAttributes & Partial<{ ...

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.