miaolz123 / vue-markdown

A Powerful and Highspeed Markdown Parser for Vue
https://miaolz123.github.io/vue-markdown/
MIT License
1.89k stars 257 forks source link

Can't display formatted markdown in vue component #20

Closed ken-mills closed 7 years ago

ken-mills commented 7 years ago

I have a simple FAQ.vue component. The content is displayed but not formatted as markdown. What am I doing wrong?

I tested the simple index.html example and understand there is a dependency on vue-markdown.js. Can you explain why the vue-markdown.js file is downloaded as a script file in the webpack-simple index.html file and not included as a dependency in the npm package? I did not see instructions in the readme for how to use vue-markdown.js?

I am using the ES6 example to import vue-markdown. I get no compilation errors and no inspector warning in Chrome. I have a large dashboard application with many vue components that is supported by a laravel backend. I plan to load vue-markdown with a large markdown file via AXIOS ajax call. Thanks for your help,

faq.vue

<template>
<div>
    <vue-markdown>##Testing 1,2,3</vue-markdown>
    <vue-markdown :source="source"></vue-markdown>
</div>
</template>

<script>
import VueMarkdown from 'vue-markdown'

export default {

components:{ 'vue-markdown' : VueMarkdown },

  data () {
    return {
        source:"#BLAH BLAH BLAH"    }
  },
...

result on screen

##Testing 1,2,3
#BLAH BLAH BLAH
ken-mills commented 7 years ago

Please ingore. My markdown was incorrectly formatted.