|
|
@@ -0,0 +1,49 @@
|
|
|
+<template>
|
|
|
+ <div v-for="component in components">
|
|
|
+ <div v-if="component.bg === true" class="component component-bg-top"> </div>
|
|
|
+ <div :class="`component ${component.type}`">
|
|
|
+ <h3>{{component.label}}</h3>
|
|
|
+ <Content :jsonContent="component.content" />
|
|
|
+ </div>
|
|
|
+ <div v-if="component.bg === true" class="component component-bg-bottom"> </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts">
|
|
|
+ import { useComponentStore } from '@/stores/component'
|
|
|
+ import { useI18n } from 'vue-i18n'
|
|
|
+ import Content from '@/components/Content.vue'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: 'Components',
|
|
|
+ components:{Content},
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ components: [] as Array<any>,
|
|
|
+ componentStore: null as any
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setup(){
|
|
|
+ const { t } = useI18n({
|
|
|
+ inheritLocale: true
|
|
|
+ })
|
|
|
+ return{
|
|
|
+ t
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async mounted () {
|
|
|
+ if(!this.componentStore){
|
|
|
+ this.componentStore = useComponentStore()
|
|
|
+ }
|
|
|
+ this.components = await this.componentStore.getComponents(this.$i18n.locale)
|
|
|
+ },
|
|
|
+ async update () {
|
|
|
+ if(!this.componentStore){
|
|
|
+ this.componentStore = useComponentStore()
|
|
|
+ }
|
|
|
+ this.components = await this.componentStore.getComponents(this.$i18n.locale)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|