Add code to store search query and perform search

This commit is contained in:
2025-11-13 00:20:02 +01:00
parent 5066ce695d
commit ef6e52c0cb
+10
View File
@@ -0,0 +1,10 @@
export default {
query: null,
apply(songs) {
const normalizedQuery = this.query?.trim()?.toLowerCase()
return normalizedQuery ? songs?.filter(
song => song.title?.toLowerCase()?.includes(normalizedQuery) || song.artist?.toLowerCase()?.includes(normalizedQuery)
) : songs
}
}