DesignMarkdown.vue 846 字节
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
<template>
  <div>
    <VueMarkdown
      :source="content"
      v-highlight
      style="width: 100%; text-align: left"
    ></VueMarkdown>
  </div>
</template>
<script>
import VueMarkdown from 'vue-markdown'
export default {
    components: {VueMarkdown},
    name: 'DesignMarkdown',
    props: {
        contentSource: undefined
    },
    data () {
        return {
            content: ''
        }
    },
    computed: {
        propsContent () {
            console.log('this')
            return this.contentSource
        }
    },
    watch: {
        contentSource: {
            handler (newVal, oldVal) {
                this.content = newVal || ''
            },
            deep: true,
            immediate: true
        }
    },
    mounted () {
        console.log('design vuemarkdown')
    },
    methods: {

    }
}
</script>