Guest User

Untitled

a guest
Oct 21st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <template>
  2. <div>
  3. <h3>{{item.title}}</h3>
  4. </div>
  5. </template>
  6.  
  7. <script>
  8. var client = require('./../plugins/client')
  9. export default {
  10. async fetch ({ store, params }) {
  11. let item = await client.get(`item/${params.id}.json`).then(res => {
  12. return res.data
  13. })
  14. store.commit('SET_ITEM', item)
  15. },
  16. data () {
  17. return {
  18. item: this.$store.state.item,
  19. }
  20. },
  21. head () {
  22. return {
  23. meta: [{
  24. 'og:title': this.item.title,
  25. 'og:description': this.item.type
  26. }]
  27. }
  28. },
  29. }
  30. </script>
Add Comment
Please, Sign In to add comment