enlazados changed to foro

This commit is contained in:
María
2025-09-16 14:24:57 +02:00
committed by María
parent 31fa587ea7
commit bdbccbb8fa
5 changed files with 6 additions and 6 deletions

45
pages/[langcode]/foro.vue Normal file
View File

@@ -0,0 +1,45 @@
<template>
<main v-if="consumoComponents" class="min-h-screen relative mx-4 md:mx-8">
<template v-for="(component, index) in consumoComponents" :key="`consumo-component-${component.component}-${index}`">
<component
:is="component.component"
v-if="component"
v-bind="component.props" />
</template>
</main>
</template>
<script>
import HeroPages from '~/components/HeroPages.vue';
import TextWithImage from '../../components/TextWithImage.vue';
import SectionWithCards from '../../components/SectionWithCards.vue';
export default {
components: {
HeroPages,
TextWithImage,
SectionWithCards
},
data() {
return {
consumoComponents: []
};
},
async created() {
const langcode = this.$route.params.langcode;
try {
const res = await import(`~/data/${langcode}/foro.json`);
this.consumoComponents = res.default;
} catch (err) {
console.error('Error al cargar contenido:', err);
this.consumoComponents = [
{
component: 'ErrorComponent',
props: {
message: 'Contenido no disponible',
},
},
];
}
}
}
</script>