syntax & variable renaming
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user