update to moving parts for site
toggle ugly but works
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user