debug fetching global data error page on ssg
This commit is contained in:
@@ -15,10 +15,11 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
setup() {
|
||||
let globalData = useState('globalData');
|
||||
globalData = globalData.value.data;
|
||||
|
||||
async setup() {
|
||||
|
||||
let globalData = await useFetchGlobalData();
|
||||
globalData = globalData.globalData._object.$sglobalData;
|
||||
|
||||
return {
|
||||
globalData
|
||||
}
|
||||
|
@@ -14,17 +14,21 @@ export default {
|
||||
setup() {
|
||||
const itemsAccueil = ref([]);
|
||||
|
||||
const { data: itemsData, error: itemsError } = useFetch('/api/items/images_accueil', { server: true });
|
||||
const { data: itemsData } = useFetch('/api/items/images_accueil', { server: true });
|
||||
|
||||
onMounted(async () => {
|
||||
if (!itemsError.value && itemsData.value) {
|
||||
if (itemsData.value) {
|
||||
itemsAccueil.value = itemsData.value.data;
|
||||
setTimeout(() => {
|
||||
startSlider();
|
||||
}, 1);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
return {
|
||||
itemsAccueil,
|
||||
itemsError
|
||||
};
|
||||
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
import Projects from '@/components/Projects.vue';
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
async setup() {
|
||||
const magasin = ref([]);
|
||||
|
||||
const { data: itemsData } = useFetch('/api/items/magasin', { server: true });
|
||||
@@ -20,8 +20,8 @@ export default {
|
||||
}
|
||||
});
|
||||
|
||||
let globalData = useState('globalData');
|
||||
globalData = globalData.value.data;
|
||||
let globalData = await useFetchGlobalData();
|
||||
globalData = globalData.globalData._object.$sglobalData;
|
||||
|
||||
return {
|
||||
globalData,
|
||||
|
Reference in New Issue
Block a user