Skip to content
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

v-show conflicts with style display binding #4784

Open
zhaozhongyu opened this issue Oct 11, 2021 · 6 comments
Open

v-show conflicts with style display binding #4784

zhaozhongyu opened this issue Oct 11, 2021 · 6 comments

Comments

@zhaozhongyu
Copy link

Version

3.2.20

Reproduction link

codepen.io

Steps to reproduce

click changeStyle

What is expected?

style change and should keep element style "display: none;" attribute via v-show

What is actually happening?

The element is displayed even if v-show value is false.


causes by commit 3f38d59 .
I understand it should be v-show control display and hide, computed style control display style.

@zhaozhongyu
Copy link
Author

I found a testcase in vShow.spec.ts name the value of 'display' set by v-show should not be overwritten by the style attribute when updated, So the issue #4768 is not a bug, it is designed like this.

or we can fix it simply like iBelieveLove@42396db

@LinusBorg

This comment has been minimized.

@zhaozhongyu

This comment has been minimized.

@LinusBorg

This comment has been minimized.

@furryablack
Copy link

furryablack commented Oct 20, 2021

I guess you can try type like
fullStyle: "'display: none'"
The case we use the bind signature - :style instead of a html attr style => it should be the 'string' i.e. "'string'"

@zhaozhongyu
Copy link
Author

style

Yeah i know this, but we are talking about why the code behaves differently when written in different ways, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants