<template>
  <div class="mavoneditor">
    <div
      class="markdown-body"
      style="width: 100%; height: 100%; overflow: hidden"
    >
      <iframe
        :src="baseurl + basePath"
        style="width: 100%; height: 100%; border: none"
      ></iframe>
    </div>
  </div>
</template>

<script>
import VueMarkdown from 'vue-markdown'
export default {
    components: {
        VueMarkdown
    },
    name: 'Mavoneditor',
    data () {
        return {
            baseurl: '/api/',
            basePath: 'admin/',
            md_data: []
        }
    },
    methods: {
        getArticles: function () {
            let that = this
            that.$axios
                .get(that.baseurl + 'admin/')
                .then((res) => {
                    console.log('获取Article=>')
                    // console.log(res.data.article);
                    // let run_array=res.data.article.map(o=>{return that.data.md_data.push(o);}); //获取参数article
                    // console.log(that.data.md_data);
                    that.md_data = res.data.article
                })
                .catch((res) => {
                    console.log(res)
                }) // get log
        }
    },
    created () {
        try {
            console.log(
                'domMain',
                document.getElementById('mainappid'),
                document.getElementById('mainappid').style
            )
            document.getElementById('mainappid').style.padding = '0'
            document.getElementById('mainappid').style.margin = '0'
        } catch (e) {
            console.log('e', e)
            throw Error(e)
        }
    }
}
</script>

<style scoped>
.mavoneditor {
  width: 100%;
  height: 100%;
}
</style>
