fix(schedule): SSR-safe props to prevent null component hydration error
This commit is contained in:
@@ -24,7 +24,7 @@ export default {
|
|||||||
favoriteGroups: typeof window !== 'undefined' ? JSON.parse(localStorage.getItem('favoriteGroups') || '[]') : [],
|
favoriteGroups: typeof window !== 'undefined' ? JSON.parse(localStorage.getItem('favoriteGroups') || '[]') : [],
|
||||||
showFavorites: false,
|
showFavorites: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
currentPageLoaded: this.schedules_paginator.current_page,
|
currentPageLoaded: this.schedules_paginator?.current_page ?? 1,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -57,13 +57,16 @@ export default {
|
|||||||
type: Object
|
type: Object
|
||||||
},
|
},
|
||||||
seo: {
|
seo: {
|
||||||
type: Object
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
},
|
},
|
||||||
breadcrumbs: {
|
breadcrumbs: {
|
||||||
type: Object
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
},
|
},
|
||||||
faculties: {
|
faculties: {
|
||||||
type: Object
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -94,8 +97,8 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<MetaTags :seo="this.seo" />
|
<MetaTags :seo="seo" />
|
||||||
<MainPageNavBar :sections="$page.props.navigation" />
|
<MainPageNavBar :sections="$page.props?.navigation" />
|
||||||
|
|
||||||
<div class="flex flex-col h-screen">
|
<div class="flex flex-col h-screen">
|
||||||
<main class="flex-grow">
|
<main class="flex-grow">
|
||||||
|
|||||||
Reference in New Issue
Block a user