4 ms·
You can use slots to pass HTML or Components into child components. You can have vue render jsx or templates, but in practice you can make interactive componen
by CaveTech 9y ago
You can use slots to pass HTML or Components into child components.
You can have vue render jsx or templates, but in practice you can make interactive components very simply using templates which are foundationally simpler and easier to grasp than JSX.
- ng12 9y agoHow so? In my mind templates and JSX are equally complex from a user standpoint. In fact I'd argue that JSX is simpler because you don't have to invent slots -- it's an obvious side effect of using JavaScript to generate your structure. Just reading about slot and slot-scope makes me think Vue's reputation for simplicity is overblown.
- ricardobeat 9y agoIt may seem "obvious" to you after being in the water with JSX for a while, but the free-style abstractions afforded by being 'just' JavaScript, like the one you mention, look incredibly complex for someone approaching an unknown codebase.