syntax & variable renaming

This commit is contained in:
Kevin
2019-06-20 01:14:29 +02:00
parent 5f961ec19a
commit 652f7db4f7
2 changed files with 7 additions and 7 deletions

View File

@@ -1,8 +1,8 @@
<template lang="pug"> <template lang="pug">
aside.nav aside.nav
.sidebar .sidebar
template(v-for='entry in menuEntries') template(v-for='category in categories')
nuxt-link(:to='entry.slug') {{ entry.title }} nuxt-link(:to='category.slug') {{ category.title }}
</template> </template>
<script> <script>
@@ -11,11 +11,11 @@ import store from '../store.json'
export default { export default {
data() { data() {
return { return {
menuEntries: [{ slug: '', title: '' }], categories: [{ slug: '', title: '' }],
} }
}, },
created() { created() {
this.menuEntries = store.map(({ title, slug }) => ({ title, slug })) this.categories = store.map(({ title, slug }) => ({ title, slug }))
} }
} }
</script> </script>

View File

@@ -13,15 +13,15 @@ import Card from '../components/Card'
export default { export default {
data () { data () {
return { return {
categoryTitle: this.$route.params.category, categoryRouteTitle: this.$route.params.category,
categories: store, categories: store,
} }
}, },
computed: { computed: {
category() { category() {
return this.categories.find(category => category.title.toLowerCase() === this.categoryTitle.toLowerCase()) return this.categories.find(category => category.title.toLowerCase() === this.categoryRouteTitle.toLowerCase())
} }
}, },
components: { Card, }, components: { Card },
} }
</script> </script>