🎨 Simplify toggling between views

This commit is contained in:
Kevin
2019-11-15 17:56:44 +01:00
parent 64d015b21b
commit 5388f2fe44
3 changed files with 31 additions and 10 deletions

13
components/CardsView.vue Normal file
View File

@@ -0,0 +1,13 @@
<template lang="pug">
.cards
Card(v-for='resource in category.resources' :resource='resource' :key='resource.title' :createCopyUrl="createCopyUrl" :isActive='activeCard === resource.cleanTitle')
</template>
<script>
import Card from './Card'
export default {
components: { Card },
props: ['category', 'createCopyUrl', 'activeCard'],
}
</script>

13
components/TableView.vue Normal file
View File

@@ -0,0 +1,13 @@
<template lang="pug">
table
TableRow(v-for='resource in category.resources' :resource='resource' :key='resource.title' :createCopyUrl="createCopyUrl" :isActive='activeCard === resource.cleanTitle')
</template>
<script>
import TableRow from '../components/TableRow'
export default {
components: { TableRow },
props: ['category', 'createCopyUrl', 'activeCard'],
}
</script>