Home.vue
1.28 KB
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
61
62
63
<template>
<v-sheet>
<!-- autocomplete에 저장된 tag 넣어서(동영상 업로드 할 때마다 tag가 저장됨) 자동완성 되게끔.-->
<v-text-field
class="mx-10 mt-4 mb-5"
prepend-inner-icon="mdi-shape"
v-model="search"
label="Tag"
placeholder="Search Tag"
type="text"
>
</v-text-field>
<!-- 동영상 리스트 -->
<v-layout justify-center>
<v-row class="mx-5">
<v-flex
xs12
sm6
v-for="(post, index) in postList"
:key="index"
class="mx-0"
>
<v-card class="mx-2 my-1">
<div>{{ post.title }}1</div>
</v-card>
</v-flex>
</v-row>
</v-layout>
</v-sheet>
</template>
<script>
// @ is an alias to /src
export default {
name: "Home",
components: {},
data() {
return {
postList: [],
search: "",
params: {
tag: ["", ""],
skip: 0
}
};
},
mounted() {
this.getPost();
},
methods: {
getPost() {
this.$axios
.get("/home/list", { params: this.params })
.then(r => {
this.postList = r.data.d;
console.log(this.postList);
})
.catch(e => {
console.log(e);
});
}
}
};
</script>