|
|
|
|
|
by ng12
2427 days ago
|
|
That's not what I'm saying. What if I have a child component I don't want to put in a separate file? What if I want a child component defined as a closure inside my parent component? What if I want one file that exports many components? React makes no judgements here -- it's completely up to me to decide what's best for my application. |
|
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...