В чем ошибка?
app.vue
<template>
<component :is="layout">
<router-view/>
</component>
</template>
<script>
export default {
name: 'App',
computed: {
layout() {
const layoutName = this.$route.meta.layout || 'DefaultLayout';
return () => import(`@/layouts/${layoutName}.vue`)
}
},
}
</script>
index.js (роутер)
...
import Home from "../views/Home";
const routes = [
{
path: '',
name: 'Home',
component: Home,
meta: {
layout: () => import('../layouts/DefaultLayout')
}
},
...
ну и собственно имеются компоненты DefaultLayout и Home.