update to moving parts for site

toggle ugly but works
This commit is contained in:
Erin
2019-07-24 21:05:21 -05:00
parent 305d6c5674
commit df95c8f29c
3 changed files with 30 additions and 8 deletions

View File

@@ -3,20 +3,32 @@
.sidebar
template(v-for='category in categories')
nuxt-link(:to='category.slug') {{ category.title }}
input(type='checkbox' :checked='cardsShown' @change="toggleCardsShown()")
</template>
<script>
import store from '../store.json'
import { mapMutations } from 'vuex'
export default {
data() {
return {
categories: [{ slug: '', title: '' }],
categories: [{ slug: '', title: '' }],
}
},
computed: {
cardsShown() {
return this.$store.state.Sidebar.cardsShown
}
},
created() {
this.categories = store.map(({ title, slug }) => ({ title, slug }))
}
this.categories = store.map(({ title, slug }) => ({ title, slug }))
},
methods: {
...mapMutations({
toggleCardsShown: 'Sidebar/toggleCardsShown',
})
}
}
</script>