3 ms·
JSX is a DSL with the ability to opt out into native JavaScript. So most complex JSX is a composition of JSX with JS driving the logical parts. Does Vue’s templ
by pldr2244 7y ago
JSX is a DSL with the ability to opt out into native JavaScript. So most complex JSX is a composition of JSX with JS driving the logical parts. Does Vue’s templating solution offer the same? (Genuine question, haven’t worked with Vue)
- cjblomqvist 7y agoIt does. You can do render functions similar to React (and optionally use JSX if you want to). It's not very common though except for library authors (especially if you need to do some clever stuff, regular vue templates can't handle all the corner cases that a raw render function can).
- mcv 7y agoIn my eperience, most people do use the templates, and especially in Vue 3, those templates are going to get compiled to extremely optimised render functions. But if you want or need to, you can also write your own render function directly, or indeed use JSX. Vue is remarkably flexible about that.