Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ariran5 opened this issue Jun 29, 2021 · 0 comments
Open

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

ariran5 opened this issue Jun 29, 2021 · 0 comments

Comments

@ariran5
Copy link

ariran5 commented Jun 29, 2021

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<{ ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant