move _category.vue to root of /pages

This commit is contained in:
Kevin Van Der Werff
2019-06-15 22:52:53 +02:00
parent 76ffd17131
commit 7d3b758489
2 changed files with 3 additions and 6 deletions

28
pages/_category.vue Normal file
View File

@@ -0,0 +1,28 @@
<template lang="pug">
div
h1 {{ category.title }}
.cards
template(v-for='resource in category.resources')
Card(:title='resource.title' :desc='resource.desc' :url='resource.url')
</template>
<script>
import store from '../store.json'
import Card from '../components/Card'
export default {
data () {
return {
categoryTitle: this.$route.params.category,
categories: store,
}
},
computed: {
category() {
return this.categories.find(category => category.title.toLowerCase() === this.categoryTitle.toLowerCase())
}
},
components: { Card, },
}
</script>