Skip to content

Instantly share code, notes, and snippets.

@a9kitkumar
Created June 13, 2019 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a9kitkumar/653b6f22b04c5ef541e2dcca70de91b5 to your computer and use it in GitHub Desktop.
Save a9kitkumar/653b6f22b04c5ef541e2dcca70de91b5 to your computer and use it in GitHub Desktop.
<template>
<v-layout>
<v-flex text-xs-left>
<v-btn color="primary" flat nuxt to="/">Back</v-btn>
<h1>{{title}}</h1><br>
<div>
<img
:src="`${image}`"
alt="Fitness_quotes"
class="mb-5"
>
</div>
<div v-html="body"></div>
</v-flex>
</v-layout>
</template>
<script>
import axios from "axios";
import config from '../config/config';
export default {
asyncData (context) {
return axios.get(config.url + config.bucket_slug + '/object-type/blogs',{
params: {
read_key: config.read_key
}
})
.then(res => {
console.log(res.data.objects[0].metadata.image.url);
return {title : res.data.objects[0].title, body: res.data.objects[0].content, image:res.data.objects[0].metadata.image.url}
});
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment