-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Description
Version
3.2.23
Reproduction link
Steps to reproduce
I'm new to Vue and this is a rather trivial issue but I think it's kind of awkward when you first encounter it, and it should be fairly easy to fix. I've included an SFC playground link that explains and demonstrates it.
When you pass a class to a component that already exists on the root element of the component, Vue is smart enough to know that it shouldn't duplicate the class name in the class
attribute, but when you also use class binding (i.e. :class
) on the root element of the component, then Vue does duplicate the class name passed to the component from its parent.
What is expected?
When the button is disabled, the class attribute should look like class="button disabled"
.
What is actually happening?
But it actually looks like class="button disabled button"
, the second occurrence of button
is redundant.