3 ms·
How about the ability to create multiple components in the same .vue file? for instance I need to define a sub-component that will be used only inside my compon
by armaxt 8y ago
How about the ability to create multiple components in the same .vue file? for instance I need to define a sub-component that will be used only inside my component, this is easy in React but with Vue I have to create another file to define this sub-component, this makes the project management becomes harder as the project grows
- jgrpf 8y agoThis is totally possible. You can create a sub component, register and use it in the same file as the parent component. Though not really recommended you can even do this: ... components: { "inline": { template: ` <h1>My inline subcomponent</h1> ` } } ...
- pier25 8y agoThat is one of the few aspects I prefer in React over Vue. But you can indeed create small inline components in .vue files. There are different approaches: https://codewithhugo.com/writing-multiple-vue-components-in-a-single-file/ https://codewithhugo.com/writing-multiple-vue-components-in-...
- deltron3030 8y ago>How about the ability to create multiple components in the same .vue file? No problem: https://www.youtube.com/watch?v=l3GHggI3_z8 https://www.youtube.com/watch?v=l3GHggI3_z8 As you can see, the're quite a few nested components in a single .vue file.