-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
:class="undefined" causes class being rendered #3173
Comments
I don’t think this is a bug, but it’s reasonable to optimize that behavior. |
<template>
<div :style="false" :class="false" :foo="false">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium modi
repudiandae, illum sequi nemo est deleniti optio distinctio quaerat quasi
dolores vitae aspernatur quisquam, voluptatibus quibusdam ullam, ipsum aut
amet?
</div>
</template> In vue |
Check out the new attributes coercion behavior https://github.com/vuejs/rfcs/blob/master/active-rfcs/0024-attribute-coercion-behavior.md |
@HcySunYang Yes, I've known that, I guess this issue belongs to the vue 2 repo, I've created one there (vuejs/vue#11902). Also, The documented behavior is |
I think this was for performance reasons. There are no practical reasons to not remove |
Only call |
I think this should be reopend as the fix in 7013e8f does not work. Problem is the |
@Liwoj Just tried, reproducible for me as well. Ping @yyx990803 |
I made a repro |
@edison1105 For |
Good catch. Would you mind commit a new issue with a working repro? |
@edison1105 I've updated the issue to reflect that, since the playground doesn't seem to keep the vue version, I included the repro for the latest commit. |
The issue is that and |
The issue still exists, does anyone have any solution? https://github.com/vuejs/rfcs/blob/master/active-rfcs/0024-attribute-coercion-behavior.md#drawbacks when I use null, empty class property remains in the tag. Vue version: 3.3.4 |
ping... |
Version
3.2.6
Steps to reproduce
What is expected?
None of
title
,class
,style
should be rendered.What is actually happening?
class
is rendered, the same thing applies tonull
.Additional info
This was fixed in v3.1.5 but is reproducible when using the latest commit.
The text was updated successfully, but these errors were encountered: