Re:Why Choose Vue.js
by ng12 on Friday June 23, 2017 @04:48PM
(#14622655)
This is my impression of templates as a tool. I dislike Vue for the same reasons I dislike Angular and Marionette.
[ Parent
| on HN ]
Re:Why Choose Vue.js
by outsidetheparty on Friday June 23, 2017 @04:56PM
(#14622716)
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.
JSX 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?
Vue 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.