rendering content pages

This commit is contained in:
SimonGschnell
2024-06-24 14:23:34 +02:00
parent f8c431e0bc
commit 7267d526bb
9 changed files with 122 additions and 17 deletions
+9 -2
View File
@@ -1,3 +1,5 @@
import raum_contentmittitel from './Content_types/Raum_contentmittitel.js'
export default {
props:{
@@ -19,6 +21,9 @@ export default {
}
},
components:{
raum_contentmittitel,
},
data() {
return {
@@ -29,12 +34,14 @@ export default {
created() {
console.log("this is the api", this.$fhcApi);
this.$fhcApi.factory.cms.content(this.content_id,this.version, this.sprache, this.sichtbar).then(res =>{
this.content = res.data;
this.content = res.data.content;
this.content_type = res.data.type;
});
},
template: /*html*/ `
<!-- div that contains the content -->
<div v-if="content" v-html="content"></div>
<component :is="content_type" v-if="content" :content="content" />
<p v-else>No content is available to display</p>
`,
};
@@ -0,0 +1,33 @@
export default {
props:{
content:{
type:String,
required:true,
},
},
mounted(){
let tables = document.getElementsByClassName("tablesorter");
for(let table of tables){
new Tabulator(table, {
layout:"fitDataStretch",
columnDefaults:{
formatter:"html",
resizable:false,
minWidth: "100px",
}
})
table.classList.add("mx-auto");
table.style.width="30em";
}
},
template: /*html*/ `
<!-- div that contains the content -->
<div v-html="content" v-if="content" :content="content" />
<p v-else>Content was not found</p>
`,
};