@onclick="v+=1" for ref v declared as var/let does not increment. <script setup> #3625
Labels
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
🐞 bug
Something isn't working
scope: script-setup
scope: sfc
Version
3.0.11
Reproduction link
sfc playground
Steps to reproduce
trigger
@click
for button withv+=1
expression two times.1st time it will reset v to 1
2nd time and onward it will stay 1
What is expected?
it is expected that v+=1 will increment value of v by 1 every time
@click
is triggered.The same way
v=v+1
orv++
worksWhat is actually happening?
v+=1
always sets the value to 1 and does not incrementvue: v3.0.11
for a
var/let v = ref()
v += 1
is compiled to:for a
const c = ref()
The text was updated successfully, but these errors were encountered: