Filter media types
This commit is contained in:
parent
712da967ce
commit
f2038bedb4
1 changed files with 7 additions and 5 deletions
|
@ -1,11 +1,13 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import medias from '@data/medias'
|
import medias from '@data/medias'
|
||||||
|
|
||||||
const mediaList = computed(() => {
|
|
||||||
return medias.filter((m) => m.type === 'book')
|
|
||||||
})
|
|
||||||
|
|
||||||
const category = ref('Books')
|
const category = ref('Books')
|
||||||
|
|
||||||
|
const mediaList = computed(() => {
|
||||||
|
return medias.filter((m) => {
|
||||||
|
return m.type === category.value.toLowerCase().slice(0, -1)
|
||||||
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -18,7 +20,7 @@ const category = ref('Books')
|
||||||
<TableTh>Checked Out</TableTh>
|
<TableTh>Checked Out</TableTh>
|
||||||
<TableTh actions>
|
<TableTh actions>
|
||||||
<Dropdown :options="['Books', 'Films', 'Albums']"
|
<Dropdown :options="['Books', 'Films', 'Albums']"
|
||||||
@select="(i) => category = (i as string)">
|
@select="(i) => (category = (i as string))">
|
||||||
{{ category }}
|
{{ category }}
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
<PrimaryButton>Add New</PrimaryButton>
|
<PrimaryButton>Add New</PrimaryButton>
|
||||||
|
|
Loading…
Reference in a new issue