4 ms·
These directives take less than a day to learn. 99% of the time it's far easier to write HTML tags with data and event binding directives than hack around with
by manigandham 7y ago
These directives take less than a day to learn. 99% of the time it's far easier to write HTML tags with data and event binding directives than hack around with JSX and passing all those props.
You can also use JSX with Vue if you want. Just add a render() function to the component. That's what happens anyway when you use a normal template, the Vue compiler turns it into a render function the same way JSX is compiled by React.
- idoubtit 7y agoUsing Vue's pseudo-HTML directives might be easier for many cases, but it is less powerful than JavaScript. In some cases, these restrictions leads to workarounds or rewrites. I agree with the grand-poster that the added value is controversial. As for JSX with Vue, it's clearly a second class citizen. For instance, last I checked, JSX + TypeScript was broken, though both are officially documented with Vue.
- keithnz 7y agoI haven't found it very limiting, however, because it is very well defined, in Vue3 they are looking to actually use this to make massive optimizations in rendering that you simply can't make when you use javascript anyway you like to assemble things.
- manigandham 7y agoYea, the 1% of the time you need that extra control then you can easily use JS render function or JSX. The documentation covers all of this: https://vuejs.org/v2/guide/render-function.html https://vuejs.org/v2/guide/render-function.html
- mmis1000 7y agoI actually found make it restricted (compare to js) improve general code quality as you don't have too much items to abuse. Probably not ideal for personal project because it won't let you fly as you want. But it is awesome for collaboration because you can't really write something way too off with it.
- shirshak55 7y agoand using promises with vue is nightmare.
- manigandham 7y agoUsing promises where? And what's difficult about them?
- Can_Not 7y ago[Citation Needed]