3 ms·
These aren't good because for 0-lists you have an empty parent containers so often you have a wrapping if outside all of that. More generally, template logic in
by Already__Taken 11mo ago
These aren't good because for 0-lists you have an empty parent containers so often you have a wrapping if outside all of that. More generally, template logic indent doubles up inside the indent levels of the template markup and I just find it ugly.
I like vue a lot more;
<ul v-if={users}>
<li v-for={some in users}>{some.name}
</ul>
- notpushkin 11mo agoAgree with sibling comments on control flow vs elements separation. For your specific case though, I think a middle ground can be found here: <ul #if={users}> {#each users as user} <li>{user.name}</li> {/each} </ul>