Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Multiple named views in single vue file #2633
What problem does this feature solve?
It would be great if I could specify multiple named views in a single .vue file. This would make it easier and more centralized to manage applications that require multiple views for each route. By having all the code in one file, it would also make it easy to update both components simultaneously.
What does the proposed API look like?
For instance, if I had header and content views:
<!-- Named slot --> <template slot="header"> <div> Header content </div> </template> <!-- Default slot --> <template> <div> Body content </div> </template>
Thanks for the proposal. Unfortunately, I think this goes against Vue rule of having one file per component and it brings a problem when creating the
This is however something you could achieve with a custom webpack loader