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
const variables cannot be updated. #6517
Comments
Yes, const variables cannot be changed in Javascript. No, this is not a bug. Is part of the language |
please reopen it. first, at Stackblitz B, button 3 also is const , but is changed. |
I don't see that behavior in the demos you linked. If you click button 3,
The only difference between the two is seen in the random number from |
I cannot reproduce that behavior in Chrome 104 on macOS. What browser are you using? |
104 edge on win... |
Ah, I see it now. It wasn't reproducing earlier because I wasn't properly following the reproduction steps. However, the behavior is the same in both StackBlitz and the Vue Playground. There's not really a bug to fix here, but I believe this is what's happening:
|
The first point is also a duplicate of #5655 |
Vue version
"vue": "^3.2.37"
Link to minimal reproduction
A:
https://sfc.vuejs.org/#eNqtkk1uwjAQha8y8gYQJKY/qygg9QC9gaUqBKeExj8aT9JF5LvXjgHRVrRddJWZN0/fczQzsidr86GXrGClq7G1BE5Sb7dCt8oaJBgBZQMeGjQKZsE6E1ro2mhH0HS9O8AmOubrhdCdJBgqfInfDazPtiilahJLnpJCRmhIKttVJEMHUO7bYSpCueuJjIYhM7qou7Z+2wh2gi+Xgm1P87tiHC+h3pc86QnHz7y/gKcnXqPvz+j0+P+FPwT4ZeA9ZPApbAnPFR1yrPTeqPniZvav4dOOroMfIf5WWt0NbMkvW2Erlg4hU5XNj87ocCpjNIvTwAlWwKRELRxI7AU7EFlXcO6aOh7Y0eUGX3mocuw1tUrm0qlsh+bdSQxgwVZXDB7EQWKGUu8lSvyJ+cX6jRuxXmjP/Afl1QLK
B:
https://stackblitz.com/edit/vitejs-vite-pxibx7?file=src%2FApp.vue&terminal=dev
Steps to reproduce
click button 1
click button 2
click button 3
click button 4
What is expected?
1
1
1
1
What is actually happening?
A 1 0 0 1
B 1 0 1 1
System Info
No response
Any additional comments?
Why do Playrground and Stackblitz produce different results, is this another bug?
No response
The text was updated successfully, but these errors were encountered: