12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <template lang="html">
- <div :id="id">
-
-
- <router-view :html="home_template_src" :full="full_home_template_loaded"/>
- </div>
- </template>
- <script>
- import { mapState, mapActions } from 'vuex'
- import { MA } from 'vuejs/api/ma-axios'
- import router from 'vuejs/route'
- export default {
- router,
- props:['id','html', 'isfront'],
- data() {
- return {
- home_template_src: null,
- full_home_template_loaded: false
- }
- },
- beforeMount() {
-
- if (!this.home_template_src) {
-
-
-
-
-
-
-
- if (this.isfront) {
-
- this.home_template_src = this.html
- }
-
- if (!this.full_home_template_loaded) {
- this.getHomeHtml()
- }
- }
- },
- methods: {
- getHomeHtml(){
- console.log('MainContent getHomeHtml');
- MA.get('materio_home/ajax/gethome')
- .then(({data}) => {
-
- this.full_home_template_loaded = true
- this.home_template_src = data.rendered
- })
- .catch((error) => {
- console.warn('Issue with getHomeHtml', error)
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- </style>
|