[web] Add the possibility to remove past search queries

This commit is contained in:
Alain Nussbaumer
2024-04-09 15:39:06 +02:00
parent e5e7702fc5
commit 0362896bfb
5 changed files with 212 additions and 257 deletions

View File

@@ -10,7 +10,7 @@
'is-active': $route.name === 'search-library'
}"
>
<a @click="search_library">
<a @click="$emit('search-library')">
<mdicon class="icon is-small" name="bookshelf" size="16" />
<span v-text="$t('page.search.tabs.library')" />
</a>
@@ -20,7 +20,7 @@
'is-active': $route.name === 'search-spotify'
}"
>
<a @click="search_spotify">
<a @click="$emit('search-spotify')">
<mdicon class="icon is-small" name="spotify" size="16" />
<span v-text="$t('page.search.tabs.spotify')" />
</a>
@@ -36,39 +36,12 @@
<script>
export default {
name: 'TabsSearch',
props: { query: { default: '', type: String } },
emits: ['search-library', 'search-spotify'],
computed: {
route_query() {
if (this.query) {
return {
limit: 3,
offset: 0,
query: this.query,
type: 'track,artist,album,composer,playlist,audiobook,podcast'
}
}
return null
},
spotify_enabled() {
return this.$store.state.spotify.webapi_token_valid
}
},
methods: {
search_library() {
this.$router.push({
name: 'search-library',
query: this.route_query
})
},
search_spotify() {
this.$router.push({
name: 'search-spotify',
query: this.route_query
})
}
}
}
</script>