Here is a suggestion for your code:
const routes = [
{
path: '/home',
component: Homepage
},
{
// Add other routes here ...
},
{
path: "*",
component: PageNotFoundComponent
}
]
If you want to nest one component inside another, you can use the <slot></slot>
element. For more information on this, check out: https://v2.vuejs.org/v2/guide/components.html#Content-Distribution-with-Slots
Example:
Parent Component:
<template>
<div>
<!-- Content from child components will go here -->
<slot></slot>
</div>
</template>
<script>
export default {
}
</script>
Child Component:
<template>
<parent-component>
<!-- Child component content goes here -->
</parent-component>
</template>
<script>
import ParentComponent from 'path-to-parent-component'
export default {
components: {ParentComponent}
}
</script>