5 ms·
> The biggest one being that you have to jump between files when modifying a single UI. This is why I still like Vue files over React ones. Vue files can have
by mimsee 5y ago
> The biggest one being that you have to jump between files when modifying a single UI.
This is why I still like Vue files over React ones. Vue files can have a <template> tag containing the HTML structure of the component, a <script> tag containing the functionality, and a <style> tag containing the CSS.
- bnchrch 5y agoWait until you try styled components
- yurishimo 5y agoI've used both. I prefer Vue for the continuity between other projects using CSS. Styled components is fine but it adds just a little more friction and ambiguity. With Vue I know exactly where the CSS goes. With Styled components, Im still in JS land where things can be defined wherever whilly-nilly as a template string; imported, passed around, and manipulated. It's a small thing, but those add up.
- ngokevin 5y agoYeah, I don't get styled components, the syntax and organization looks like a mess. I love using Stylus with Vue single-file-components, it lets me use a lot of CSS-specific patterns and macros. Using Stylus blocks, I like making things responsive just by defining a media query in a block and then doing like: .container flexRowCenter() +desktop() flexColumnCenter()
- alvarlagerlof 5y agoBetter, but still needs that linking, and you loose your glancable html structure in.
- Zababa 5y agoThat's one of the things I like about Svelte and Vue, everything is together in one file. Here's a simple example from the Svelte tutorial: https://svelte.dev/tutorial/numeric-inputs https://svelte.dev/tutorial/numeric-inputs (click the "Show me" button).