miaolz123 / vue-markdown

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

How to listen to 'rendered' event? #23

Closed kingsloi closed 7 years ago

kingsloi commented 7 years ago

Hi,

I'm having a hard time trying to access the this.$emit('rendered', outHtml)event emitted from the render method.

How do I listen to that event?

I've tried:

  created() {
    this.$on('rendered', () => {
      alert('here');
    });
  },

But no luck. Any ideas?

kingsloi commented 7 years ago

Oops, I think I had my method incorrectly in the computed object, not the methods.

    <vue-markdown :source="markdown" @rendered="isReadyForPrerender()"></vue-markdown>