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
Yes, it was deliberate choice as result of research. Previous versions had @click="edit(area.id)" style of event handlers, similar to vue / alpine / lit / etc, but as it turned out, that's quite limiting and not as clear.
Few reasons why :onclick="event => {...}" is a better choice:
It gives explicit event argument, allowing to avoid implicit magic like $event or event etc
It is more consistent with el.onclick = handler in JS. All other attributes set value like that :x="y"
It makes obvious that it's function body that permits let, const etc. :onclick="const x = 1;" is confusing, :onclick="()=>{const x = 1;}" is not.
Vue/alpine has ambiguity where :onclick="handler()" is identical to :onclick="handler", which is confusing.
Currently if I want to pass a parameter on an onclick Event, I have to call it inside an arrow function like this
however it would be nice, if I could call it just like this
The text was updated successfully, but these errors were encountered: