3 ms·
I dislike the templating language, preferring jsx which is mostly standard js syntax, e.g.: Vue: <li v-for="i in items">{{i}}</li> React: items.map((i) => <li
by ipsum2 8y ago
I dislike the templating language, preferring jsx which is mostly standard js syntax, e.g.:
Vue: <li v-for="i in items">{{i}}</li>
React: items.map((i) => <li>{i}</li>)
- bartaxyz 8y agoJust to make things clear. You can use JSX with Vue as well. It's even a recognized way to write code in the official documentation (https://vuejs.org/v2/guide/render-function.html#JSX https://vuejs.org/v2/guide/render-function.html#JSX). JSX is just a language that can be interpreted into code for React & Vue.
- Can_Not 8y agoNot to mention that you can use Jade/pug, also.
- Jare 8y agoIIRC you can use JSX with Vue via a Babel plugin [1]. I can't vouch for it personally but it should be pretty easy to use. [1] https://github.com/vuejs/babel-plugin-transform-vue-jsx#usage https://github.com/vuejs/babel-plugin-transform-vue-jsx#usag...
- alayek 8y agoI learned this the hard way, coming from React to Vue land; that v-for on an element would also repeat the element itself. With React, it was pretty clear which element / component would repeat.
- Bizarro 8y ago"Stringy code" is an issue, but it's more declarative and readable than JSX map.
- kyriakos 8y agoexactly that. I prefer using javascript than inventing a template DSL