Mavoneditor.vue 1.6 KB
Newer Older
yma16's avatar
yma16 已提交
1 2
<template>
  <div class="mavoneditor">
Y
yma16 已提交
3 4 5 6 7 8 9 10
    <div
      class="markdown-body"
      style="width: 100%; height: 100%; overflow: hidden"
    >
      <iframe
        :src="baseurl + basePath"
        style="width: 100%; height: 100%; border: none"
      ></iframe>
yma16's avatar
yma16 已提交
11 12 13 14 15 16
    </div>
  </div>
</template>

<script>
export default {
yma16's avatar
yma16 已提交
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
    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)
        }
yma16's avatar
yma16 已提交
55
    }
yma16's avatar
yma16 已提交
56
}
yma16's avatar
yma16 已提交
57 58 59
</script>

<style scoped>
Y
yma16 已提交
60 61 62
.mavoneditor {
  width: 100%;
  height: 100%;
yma16's avatar
yma16 已提交
63 64
}
</style>