3 ms·
Ternary operators in JSX are valid javascript expressions. As is anything that goes into {} All of the following is neither Javascript nor HTML: v-for=”x
by dmitriid 9y ago
Ternary operators in JSX are valid javascript expressions. As is anything that goes into {}
All of the following is neither Javascript nor HTML:
v-for=”x in list”
v-if=”conditional”
v-on:click=“function”
v-bind:key=“something.id”
etc. etc. etc.
- bpicolo 9y agoI'm aware of that bit, I just think they're an ugly piece of control flow inside JSX, and they're also not a particularly versatile piece of control flow. Especially for the else-if case - you end up with repetitive conditionals to replicate that.