There are many ways to do this, i would recommend checking out using a Vue3 composable https://vuejs.org/guide/reusability/composables.html in that case your search will call a method on the composable and you can reuse the results (and the search) in any components you want at any level...
Apr 17, 2023
3
Level 1
Live search filter on parent component
I was trying to do some vue/inertia/laravel project but got stuck at this. I have a search box on the topNav component and the results appear on the layout at the bottom. the filters Object for search (input value) which is coming from inertia/laravel can be accessed from the bottom layout (thats where its routed from laravel). I do not know if it can be accessed from the TopNav component since it would be a parent. If there is anyway to do this in Inertia/vue, please let me know. Should we use Pinia for this kind of thing?
Thanks all.
Please or to participate in this conversation.