mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 18:11:16 +01:00
filter now persists between views
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user