Vue.config.productionTip = false
Vue.config.devtools = false
new Vue({
el: '#app',
data() {
return {
proposedCourses: {
"0bEiO5zcBCHv3Wd2lxHjjRepB": {
"name": "math",
"credits": 4,
"professors": [
"Samatha"
],
"description": "come and learn some math",
"prereqs": "",
"comment": "",
"maxEnrollment": 100,
"times": [{
"day": 2,
"start": 900,
"end": 1100
},
{
"day": 4,
"start": 900,
"end": 1100
}
],
"departments": [
"mathematics"
],
"submitted": true
},
"BsSbrbjTH5FyV7gWdPjeDPqpw": {
"name": "biology",
"credits": 4,
"professors": [
"Reuven"
],
"description": "learn about biology and stuff",
"prereqs": "",
"comment": "",
"maxEnrollment": 20,
"times": [{
"day": 3,
"start": 900,
"end": 1100
},
{
"day": 4,
"start": 900,
"end": 1100
}
],
"departments": [
"biology"
],
"submitted": true
}
}
}
},
computed: {
courses() {
return Object.values(this.proposedCourses).map(({
name,
description,
professors
}) => ({
name,
description,
professors
}))
}
}
})
<script src="https://vuejs.org/js/vue.js"></script>
<div id="app">
<ul>
<li v-for="{ name, description, professors } in courses" :key="name">
<p>{{ name }}</p>
<p>{{ description }}</p>
<p>{{ professors }}</p>
</li>
</ul>
</div>