Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I find the JSX loop infinitely easier to understand what's going on. It's a javascript map. With your Vue example, what is listItem? An array? Can it be an object? Does listItem need a special decorator for v-for to be able to loop through it?

So many initial questions that just aren't there if you just use Javascript.



I'm not entirely sold on Vue, I've never used it before, and I'm happy to use JSX but the Vue template code is far, far clearer to me.


it's just plain for(x in list){ .. }

v-for="item in list"

if you need idx:

v-for="(item, i) in list"

pretty standard stuffs


Cool, but in JSX it's just javascript as you would write it anywhere else in your app, except encapsulated in braces. How is that not simpler for people who should be Javascript developers?


I thought the whole point was that you didn't have to write loops in Vue.js and yet here is a loop in Vue.js.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: