We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
computed
v-if
3.5.8
https://play.vuejs.org/#eNqNVE2T0kAQ/Su9uSRUIWjpCQOrrnvQKnVLPeYym3RgdoeZ1HwAFpX/bk8nENgCSw4w0/263+uPYZ98bJrJJmAyS3JXWtl4cOhDA0ro5bxIvCuSRaHlujHWwx4s1tBCbc0aUgpLj647s256+2QaLzEruQsNhS6Ndh5qJZYwjymyWiiHo+itgy69NBrKFTHiZ+FFNtpTFMMnG6ECUtDNcCt0GwPzaaeX1NHF47pRwiPdIK/kJv5CzqJmzDvtLI/BeyL7UCpZPlN9AyvVCevgKQfk0w7GyaZdtnx6SpGMqTNUVS2XkydnNLWPNVNCopQK7Y8mVkXdmwF7ok8oZbZf2eZtwPHBXq6wfL5gf3K7aCuSB4sO7QaL5Ojzwi7Rd+77X99xR+ejc22qoAj9D+dPdEaFqLGDfQq6ItknOFb7hacr9fK3u9951O5QVBQakS3ji4SmHbt9rfRB7tvJO46jMVIXD5vyv/sX2xs8VmdL+J4A2qOtRYnwYE3jOuI4+NsZPBqjUGhCEWm3ig2D5lBhLTVySM7fi2xEuGFf71bCEu5Am2UjmC8g4/gJL9YtpG9SmEH6Oh0NsW5ltsf830yFKu9lLLI0OtNxp5EQIih/aGgbU1xf7WG3z44AvM+wkhWO+y0es4Yx/DEBtlIp6iuCX+HQQloqYgbpYGuNXt70afuF5/PL5xJTzm/id3wu+z1zUAcicTrrCoO2PXtBvVTYvJJ1n4Jn2gl/UUf34caSrsjA55Ymd8SfCLwSf6HEQyoe6LV0w/nis+f/sqT9C30RtUA=
click hide , mutate, show in sequence, you will see the computed result is wrong!
hide
mutate
show
const flagChar = computed(() => (props.flag ? '1' : '0'));
computed result is 1 if flag is true
true
some optimizations in vue related to 'v-if' block the computed hooks to take place.
System: OS: Windows 11 10.0.22631 CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900HX Memory: 12.95 GB / 31.75 GB Binaries: Node: 20.12.2 - D:\nodejs\node.EXE Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD npm: 10.8.1 - D:\nodejs\npm.CMD pnpm: 9.6.0 - ~\AppData\Local\pnpm\pnpm.CMD Browsers: Edge: Chromium (127.0.2651.74) Internet Explorer: 11.0.22621.3527 npmPackages: vue: ^3.4.29 => 3.5.8
When you switch the positions of flag and flagChar, the bug will disappear.
flag
flagChar
The text was updated successfully, but these errors were encountered:
Closing as a duplicate of #12020
Sorry, something went wrong.
duplicate of #12020
No branches or pull requests
Vue version
3.5.8
Link to minimal reproduction
https://play.vuejs.org/#eNqNVE2T0kAQ/Su9uSRUIWjpCQOrrnvQKnVLPeYym3RgdoeZ1HwAFpX/bk8nENgCSw4w0/263+uPYZ98bJrJJmAyS3JXWtl4cOhDA0ro5bxIvCuSRaHlujHWwx4s1tBCbc0aUgpLj647s256+2QaLzEruQsNhS6Ndh5qJZYwjymyWiiHo+itgy69NBrKFTHiZ+FFNtpTFMMnG6ECUtDNcCt0GwPzaaeX1NHF47pRwiPdIK/kJv5CzqJmzDvtLI/BeyL7UCpZPlN9AyvVCevgKQfk0w7GyaZdtnx6SpGMqTNUVS2XkydnNLWPNVNCopQK7Y8mVkXdmwF7ok8oZbZf2eZtwPHBXq6wfL5gf3K7aCuSB4sO7QaL5Ojzwi7Rd+77X99xR+ejc22qoAj9D+dPdEaFqLGDfQq6ItknOFb7hacr9fK3u9951O5QVBQakS3ji4SmHbt9rfRB7tvJO46jMVIXD5vyv/sX2xs8VmdL+J4A2qOtRYnwYE3jOuI4+NsZPBqjUGhCEWm3ig2D5lBhLTVySM7fi2xEuGFf71bCEu5Am2UjmC8g4/gJL9YtpG9SmEH6Oh0NsW5ltsf830yFKu9lLLI0OtNxp5EQIih/aGgbU1xf7WG3z44AvM+wkhWO+y0es4Yx/DEBtlIp6iuCX+HQQloqYgbpYGuNXt70afuF5/PL5xJTzm/id3wu+z1zUAcicTrrCoO2PXtBvVTYvJJ1n4Jn2gl/UUf34caSrsjA55Ymd8SfCLwSf6HEQyoe6LV0w/nis+f/sqT9C30RtUA=
Steps to reproduce
click
hide
,mutate
,show
in sequence, you will see the computed result is wrong!What is expected?
computed result is 1 if flag is
true
What is actually happening?
some optimizations in vue related to 'v-if' block the
computed
hooks to take place.System Info
Any additional comments?
When you switch the positions of
flag
andflagChar
, the bug will disappear.The text was updated successfully, but these errors were encountered: