filter now persists between views

This commit is contained in:
zurdi zurdo
2023-04-25 17:47:23 +02:00
parent 3e45d3ce1b
commit 72efe94b2a
2 changed files with 4 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
<script setup>
import { storeFilter } from '@/stores/filter'
import { inject, ref } from 'vue'
import { inject, ref, onMounted } from 'vue'
// Props
const filter = storeFilter()
@@ -8,6 +8,8 @@ const filterValue = ref('')
// Event listeners bus
const emitter = inject('emitter')
onMounted(() => { filterValue.value = filter.value })
</script>
<template>

View File

@@ -46,7 +46,7 @@ async function getRoms(platform) {
gettingRoms.value = false
}
onMounted(async () => { getRoms(route.params.platform) })
onMounted(async () => { getRoms(route.params.platform)})
onBeforeRouteUpdate(async (to, _) => { getRoms(to.params.platform) })
</script>