🎨 Simplify toggling between views
This commit is contained in:
13
components/CardsView.vue
Normal file
13
components/CardsView.vue
Normal 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
13
components/TableView.vue
Normal 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>
|
||||
Reference in New Issue
Block a user