Migrating to Vue3 How can I have attributes on a component's root element and native event listeners on a child element?

22 Views Asked by At

I need to have attributes including classes and general attributes in root element and extract all native events on child element in a component. According to the new Vue3 documentation there should be some workaround with that since now we have only attrs including everything at once.

I have a simple example of Vue2 code in the template block

<div v-bind="$attrs">
    <button v-on="$listeners">
    </button>
</div>

How do I migrate this to Vue3?

I'm expecting to have attributes on a component's root element and all native events on a child element

0

There are 0 best solutions below