New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double class getting binded #1806
Comments
I don't think this is a bug... You can add your own classes to the component this way which is quite useful |
I'm not referencing the feature, which is totally fine. What is wrong is that your final component will end up with two identical class names, as can be seen in the fiddle. You would never write your code as |
I see but you're the one writing |
Despite the reasons behind the repeated class, Vue could be merging instead of appending the classes. The same way when using jQuery.addClass() you expect the library to add the class only if doesn't already exists. You don't expect it to fix your mistakes, but to help you keep your code clean. |
It could be a feature yet the example you gave is clearly a developer mistake, do you have a real use case? The jQuery example you're providing doesn't relate to this because we are talking about adding a class to a component that already holds that class |
In my application I'm using the same class to locate the dom and init Vue on it as to style it after. My initial dom would be Again, I don't think its a big deal, its just not what I would expect from a class merging feature. |
When a class is set in an dom element which is being initied with Vue and the same class is set in the component root dom element, the final result is a double class. You can see the results here, check with the console the dom and you should see "compClass compClass" instead of just one.
It's not a big deal but doesn't seem the expected behaviour.
The text was updated successfully, but these errors were encountered: