4 ms·
That's my least favourite thing about Vue. One directory per component makes so much more sense to me, not having a mix of syntaxes in a single file. Still, Vu
by petepete 6y ago
That's my least favourite thing about Vue. One directory per component makes so much more sense to me, not having a mix of syntaxes in a single file.
Still, Vue is my favourite tech for SPAs.
- manigandham 6y agoVue (like with most of its features) let's you do that if you want. The <script> and <style> tags in the .vue file can reference other files so you can have a directory per component with separate code files. Sometimes that's helpful for better code completion and formatting too.
- jtwaleson 6y agoI really love single file components. We are extending the syntax more by also adding <specification> and <requirements> tags to single file components. Great for automatically generating documentation and keeping it in the same place as the components. Was a bit afraid that the compiler would protest, but so far so good.
- buzzwordninja 6y agoWhere do you put the elements? Next to the <template> or inside it?
- jtwaleson 6y agoNext to it, so that it doesn't interfere with either <style>, <script> or <template>.
- rk06 6y agoVue does allow you to split css, js and html to separate files by using src attribute in sfc file. Ref: https://vuejs.org/v2/guide/single-file-components.html#What-About-Separation-of-Concerns https://vuejs.org/v2/guide/single-file-components.html#What-...