Mavoneditor.vue 1.7 KB
Newer Older
yma16's avatar
yma16 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
<template>
  <div class="mavoneditor">
    <div class="markdown-body" style="width:100%;height:100%;overflow:hidden;">
      <iframe src='http://yongma16.xyz/admin/' style="width:100%;height:100%;border:none;"></iframe>
    </div>
  </div>
</template>

<script>
import VueMarkdown from 'vue-markdown'
import axios from 'axios'
export default {
  components: {
    VueMarkdown
  },
  name: 'Mavoneditor',
  data () {
    return {
      baseurl: 'http://yongma16.xyz/admin/',
      md_data: []
    }
  },
  methods: {
    getArticles: function () {
      let that = this
      axios
        .get(that.baseurl)
        .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)
    }
    let that = this
    console.log('测试created!')
    axios
      .get(that.baseurl)
      .then((res) => {
        console.log('获取Article')
        //   console.log(res,res.data,res.data.msg);

        that.md_data.push(res.data.article) // markdown值传递
      })
      .catch((res) => {
        console.log(res)
      }) // get log
  }
}
</script>

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