wip: mentor dropdown

This commit is contained in:
Livio Bieri 2024-01-18 15:05:29 +01:00
parent 09b2586262
commit ab494a1c67
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
<script setup lang="ts">
import { onMounted, ref } from "vue";
const mentors = ref([]);
onMounted(async () => {
const response = await fetch("/api/mentor/mentors");
if (response.ok) {
mentors.value = await response.json();
}
});
</script>
<template>
<div>
<code>{{ mentors }} Hello</code>
<select>
<option v-for="mentor in mentors" :key="mentor.id" :value="mentor.id">
{{ mentor.first_name }} {{ mentor.last_name }}
</option>
</select>
</div>
</template>