-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
<template>
<TheParent>
<ThirdPartyChild :class="'mx-2'">
Text
</ThirdPartyChild>
</TheParent>
</template>
<template>
<div>
<component
:is="isLink ? 'a' : 'button'"
class="my-button"
v-bind="$attrs"
>
<slot></slot>
</component>
</div>
</template>
// inherit attributes is false for this component, they are passed to the v-bind
wrapper.html()
gives
<div class="the-parent">
<button class="mx-2 my-button">
Text
</button>
</div>
However, when passed through V3SS it gives
<div class="the-parent">
<button class="mx-2">
Text
</button>
</div>
Because of stringifyAttributes
. I think the solution for this would be to loop over more of the virtual DOM to find both the V-DOM node that has the mx-2
and the one with the my-button
? Then like, find a way to combine those? I'm not sure. This may be too much of an edge case to jump through all those hoops. For now I'm just going to document it here and add class
to the default list of attributesNotToStringify
. Since I can't really think of a good case where you'd care to see the object version over the final rendered version (class="{ 'p1': true }"
vs class="p1"
).
Metadata
Metadata
Assignees
Labels
No labels