Search code examples
vuejs3

How to handle click event on 3rd party components in vue3 as native is removed


In vue 2 for my 3rd party component it was something like this

<some-other-component @click.native="doSomthing" />

but now in vue 3 as .native is removed, how to handle click event for that component? I don't have the code for some-other-component as its from some 3rd party.


Solution

  • Adding an div as a wrapper should work as expected:

    <div @click="handleClick">
      <some-other-component @click.native="doSomthing" />
    </div>