<template>
<!-- A mustache-like template -->
</template>
<script>
// JS, TS, or whatever
</script>
<style scoped>
/* CSS, LESS, SCSS or whatever */
</style>
That components may use other components itself, no part of SFCs disallow that.I've never remotely wanted anything similar to this in Vue, but I have seen what you're talking about used in React, mostly for component wrappers to encapsulate logic. It's not something I like using or seeing but that could easily be swayed by my preference for Vue.
See how it's done in the guide. It wouldn't be as natural as react allows but should suffice for tiny, contained sub components.
https://vuejs.org/v2/guide/index.html#Composing-with-Compone...
This was true of me as well until actually playing more with React. In practice, being able to very quickly extract a child component by just copying a chunk of code to a different spot in the same file is a very nice workflow benefit I now sorely miss when using Vue. In Vue my components tend to be larger and more complex than they are in React because I feel like some small extraction I want to make doesn't "deserve" it's own dedicated file, whereas in React I just quickly make a new function that returns some JSX and I'm done.
But the template string is just a string, right? Can you get the same IDE integration while avoiding SFCs?
The only thing that SFCs do is create a render function for you (as well as some CSS scoping magic). You can do that all yourself and that is all documented and supported behavior.
You have completely the wrong idea here and, honestly, this is all in the documentation.
> React makes no judgements here
Vue typically has fewer opinions than React (and FAR less than Angular) in my experience.
I prefer having the template, styles, and code together, but it isn't required.
In fact that's what I've encountered in most companies, and what I usually do for my side projects. Basically you output a <app>.js and <app>.css and integrate those in your app layouts / templates.
That's a problem with all these CLI and all those tutorial targeting SPA with a node backend. But IIRC vue-cli as options to help you achieve that, but the docs are not always the clearest for this.
I'm going to try separating the frontend and serving it with nginx instead, and only use Django to provide an API for the DB. Maybe I’ll be able to figure that out. My biggest issue is that there are no decent guides for any of this, documentation is allaround terrible and even if there is some guide, it doesn’t work.
Honestly I think this is a step backwards. How many components my "component" is built out of should be an implementation detail.