4 ms·
Ok... I mean, JSX is templates too; it's just a different syntax. Vue supports JSX if you prefer that syntax. I think you have a mistaken impression of Vue, i
by outsidetheparty 9y ago
Ok... I mean, JSX is templates too; it's just a different syntax. Vue supports JSX if you prefer that syntax.
I think you have a mistaken impression of Vue, it's much more similar to React than it is to Angular.
- ng12 9y agoJSX is different though -- it's sugar around a 1:1 mapping to plain old JavaScript. There's no magic behind the scenes binding variables or interpreting stringly-typed code. I wasn't aware you could use JSX with Vue. If you do, what benefits does Vue offer?
- elcritch 9y agoVue simplifies a lot of the "data propagation" from what I've seen of React. I loved React's vdom and props, but just felt the syntax for props (e.g. `.setProp({name: val})` was excessive boiler plate. Vue simplifies that aspect with reactive props and data, its just more intuitive for me than React. One big improvement is the really nice system for `computed` and `watch` properties which reactively transform data. Your templates (jsx or the default html-directives, which I prefer) can rely on `computed` properties to transform from say an Dict to a list for say a list of `li` components. It gives a nice "raw input data -> reactive data transforms -> reactive html repr` flow.