<template>
  <div>
    <h1 class="title">
     {{ post.title }}
    </h1>
    <div v-html="post.body"></div>
  </div>
</template>

<script>
  export default {
    head () {
      return {
        title: this.post.title
      }
    },
    async fetch ({ store, params }) {
      if (store.state.currentPost.slug !== params.slug) {
        await store.dispatch('getPost', params.slug)
      }
    },
    computed: {
      post () {
        return this.$store.state.currentPost
      }
    }
  }
</script>

<template>
  <div>
    <h1 class="title">
     {{ post.title }}
    </h1>
    <div v-html="post.body"></div>
  </div>
</template>

<script>
  export default {
    head () {
      return {
        title: this.post.title
      }
    },
    fetch ({ store, params }) {
      if (store.state.currentPost.slug !== params.slug) {
        store.dispatch('getPost', params.slug)
      }
    },
    computed: {
      post () {
        return this.$store.state.currentPost
      }
    }
  }
</script>

Revert "Added async await for sync method"
Revert "Added async await for sync method"

This reverts commit e257f3d46a49b94c49cc3791460053b6c4bc8d22.
