Some ssr issue solved

This commit is contained in:
Bahadir Sofuoglu 2022-09-13 14:29:45 +03:00
parent 699a2d7398
commit 148a17057f
9 changed files with 44 additions and 16 deletions

19
app.vue
View file

@ -1,8 +1,7 @@
<template>
<NuxtLayout v-if="$route.name !== 'index'">
<NuxtLayout :name="layout">
<NuxtPage />
</NuxtLayout>
<NuxtPage v-else />
</template>
<script>
@ -15,7 +14,21 @@ export default {
newsService: null,
data() {
return {
storageKey: 'primevue'
storageKey: 'primevue',
layout: 'custom',
}
},
watch: {
$route: {
immediate: true,
handler(to) {
if (to.name === 'index') {
this.layout = 'custom';
}
else {
this.layout = 'default';
}
}
}
},
created() {