1👍
You may transmit all of the attributes from the parent component to a child component in Vue 3 by using the v-bind="$attrs" functionality.
<template>
<component
:is="tag"
:class="twMerge(clsx('font-medium text-base', classAttrs))"
v-bind="{ ...$attrs, class: undefined }"
>
<slot>
{{ label }}
</slot>
</component>
</template>
0👍
Removing useAttrs
, and adding :class="twMerge(clsx('text-base font-medium', $attrs.class))"
simple solved my issue.
Source:stackexchange.com