You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
locally defined variables in a function scope should not be prefixed with _ctx
when referenced inside the scope.
What is actually happening?
a reference to a local variable declared in the function scope is prefixed with _ctx
variables defined in the function scope should be treated the same like named arguments
for reference
code is compiled from
bad <button@click="(msg)=>{ let a = 'the type is ' + msg.type output = a }">
click
</button>
to
_createElementVNode("button", {
onClick: _cache[1] || (_cache[1] = (msg)=>{
let a = 'the type is ' + msg.type
_isRef(output) ? output.value = _ctx.a : output = a
})
}, " click "),
inconsistent prefix usage
_isRef(output) ? output.value = _ctx.a : output = a
there is currently some inconsistency for using a
the usage of a should probably be consistent for both branches of the condition
The text was updated successfully, but these errors were encountered:
Version
3.2.8
Reproduction link
sfc playground
Steps to reproduce
see bad case in repro link
What is expected?
locally defined variables in a function scope should not be prefixed with _ctx
when referenced inside the scope.
What is actually happening?
a reference to a local variable declared in the function scope is prefixed with _ctx
variables defined in the function scope should be treated the same like named arguments
for reference
code is compiled from
to
_createElementVNode("button", { onClick: _cache[1] || (_cache[1] = (msg)=>{ let a = 'the type is ' + msg.type _isRef(output) ? output.value = _ctx.a : output = a }) }, " click "),
inconsistent prefix usage
_isRef(output) ? output.value = _ctx.a : output = a
there is currently some inconsistency for using
a
the usage of
a
should probably be consistent for both branches of the conditionThe text was updated successfully, but these errors were encountered: