You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
876 B
Vue

6 years ago
<template>
<div>
<h2>Browse Threads</h2>
<div class="card card-body" v-for="thread in threads" v-bind:key="thread.id">
<p>{{ thread.creator.name }}
<h3>{{ thread.thread_title }}</h3>
</div>
</div>
</template>
<script>
export default {
data() {
return {
threads: [],
thread: {
id: '',
6 years ago
thread_title: '',
creator: {
name: ''
},
},
thread_id: '',
edit: false
}
},
created() {
this.fetchThreads();
},
methods: {
fetchThreads() {
fetch("api/threads")
6 years ago
.then(res => res.json())
.then(res => {
6 years ago
this.threads = res.data;
});
}
}
}
</script>