title: Vue component event after render
body: <p>Is there an event in Vue that gets fired after an element re-renders? I have an object that updates, which causes my template to update. After it updates I want to trigger an event which runs a jQuery function. The code looks like this:</p>
  
  <pre><code>template: `
      &lt;div class="undo-margin"&gt;
          &lt;div class="gradient"&gt;
              &lt;img v-bind:src="blogPost.thumbnail"/&gt;
              &lt;h1 class="align-bottom"&gt;{{blogPost.title}}&lt;/h1&gt;
          &lt;/div&gt;
  
          &lt;div class="container bg-faded"&gt;
              &lt;article v-html="blogPost.article"&gt;&lt;/article&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  `,
  props: ["blogid"],
  data: function () {
      return blogPageData;
  },
  mounted: function () {
      const blogid = jQuery("#blogPage").attr("blogid");
      if (this.authdata.roles.indexOf("Administrator") !== -1) {
          this.isAdmin = true;
      }
  
      this.getBlogPost(blogid);
  },
  methods: {
      getBlogPost: function (blogid) {
          var element = this;
          $.ajax({
              url: `/api/blog/${blogid}`,
              type: "get",
              headers: headers,
              success: function (data) {
                  if (data === undefined) {
                      window.location.replace("/blog");
                  } else {
                      element.isDetails = true;
                      element.blogPost = data;
                  }
              },
              error: function (data) {
                  window.location.replace("/blog");
                  errorData.error = data.responseText;
              }
          });
      }
  },
  watch: {
      blogPost: function () {
          console.log(this.blogPost);
          jQuery("pre").each((i, e) =&gt; {
              hljs.highlightBlock(e);
          });
      }
  }
  </code></pre>
  
  <p>As you see, I tried using the watch event, however when the watch event triggers, my page is not updated yet. blogPost however has been changed, but vue is still rendering the page. I know I could theoretically fix this by adding a setTimeout, but I would prefer something cleaner. </p>