The component tag of the parent component in vue adds class to the class sharing of the top-level dom of the child component?

parent component:
< login-pw class= "fuck" > < / < login-pw >

Sub-component:

<div class="login">
    
</div>

under F12, it looks like class= "fuck login"

is this bug or true?

Mar.25,2021

that's what it is.


ide/class-and-style.html-sharp%E7%94%A8%E5%9C%A8%E7%BB%84%E4%BB%B6%E4%B8%8A" rel=" nofollow noreferrer "> vue official website : vue is designed in this way

when you use the class attribute on a custom component, these classes are added to the root element of the component. Classes that already exist on this element will not be overwritten.
Menu