Vuejs testing markdown

by fguillen

HTML

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue-markdown.common.min.js"></script>
<div id="app">
  <h2>Testing</h2>
  <vue-markdown :source="content" v-on:rendered="afterRenderContent"></vue-markdown>
</div>

Vue

Vue.use(VueMarkdown);

const app = 
  new Vue({
    el: "#app",
    data: {
      content: "# This is my text"
    },
    methods: {
      afterRenderContent: function(todo){
        var headers = document.querySelectorAll("h1");
        console.log("headers", headers);
      }
    }
  })