feat(frontend): Zoekfunctie voor leerpaden geïmplementeerd

This commit is contained in:
Gerald Schmittinger 2025-03-25 01:49:01 +01:00
parent a9643838b7
commit f9e2166504
9 changed files with 186 additions and 14 deletions

View file

@ -0,0 +1,36 @@
<script setup lang="ts">
import {useI18n} from "vue-i18n";
import {useRoute, useRouter} from "vue-router";
import {computed, ref} from "vue";
const route = useRoute();
const router = useRouter();
const { t } = useI18n();
const SEARCH_PATH = "/learningPath/search";
const query = computed({
get: () => route.query.query as string | null,
set: (newValue) => router.push({path: SEARCH_PATH, query: {query: newValue}})
});
const queryInput = ref(query.value);
function search() {
query.value = queryInput.value;
}
</script>
<template>
<v-text-field
class="search-field"
:label="t('search')"
append-inner-icon="mdi-magnify"
v-model="queryInput"
@keyup.enter="search()"
@click:append-inner="search()"
></v-text-field>
</template>
<style scoped>
</style>