-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDetail.vue
60 lines (49 loc) · 1.4 KB
/
Detail.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<template>
<h1 style="text-align: center;">Blog Details</h1>
<v-container class="det">
<v-row>
<v-col cols="12">
<v-card>
<v-card-title>
{{blog.title}}
</v-card-title>
<v-card-item>
<div class="text-caption">
{{blog.body}}
</div>
<!-- React can be used to develop single-page, mobile, or server-rendered applications with frameworks like Next.js. Because React is only concerned with the user interface and rendering components to the DOM, React applications often rely on libraries for routing and other client-side functionality. -->
</v-card-item>
</v-card>
</v-col>
</v-row>
</v-container>
</template>
<script>
import axios from 'axios'
export default {
data() {
return {
blog : "",
}
},
methods:{
readData(){
axios.get('https://jsonplaceholder.typicode.com/posts/'+this.$route.params.id)
.then(response => {
this.blog = response.data;
})
.catch(error => {
console.log(error);
})
}
},
created(){
this.readData();
}
}
</script>
<style>
.det{
background-color: aquamarine;
}
</style>