Mavoneditor.vue 1.7 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
    </div>
  </div>
</template>

<script>
yma16's avatar
yma16 已提交
16
import VueMarkdown from 'vue-markdown'
yma16's avatar
yma16 已提交
17
export default {
yma16's avatar
yma16 已提交
18 19
    components: {
        VueMarkdown
Y
yma16 已提交
20
    },
yma16's avatar
yma16 已提交
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 55 56 57 58
    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 已提交
59
    }
yma16's avatar
yma16 已提交
60
}
yma16's avatar
yma16 已提交
61 62 63
</script>

<style scoped>
Y
yma16 已提交
64 65 66
.mavoneditor {
  width: 100%;
  height: 100%;
yma16's avatar
yma16 已提交
67 68
}
</style>