initial commit
All checks were successful
Build and Publish / Build Yale Access Backend (push) Successful in 28s
Build and Publish / Build Yale Access Frontend (push) Successful in 47s
Build and Publish / Push Yale Access Backend Docker Image (push) Successful in 9s
Build and Publish / Push Yale Access Frontend Docker Image (push) Successful in 10s
All checks were successful
Build and Publish / Build Yale Access Backend (push) Successful in 28s
Build and Publish / Build Yale Access Frontend (push) Successful in 47s
Build and Publish / Push Yale Access Backend Docker Image (push) Successful in 9s
Build and Publish / Push Yale Access Frontend Docker Image (push) Successful in 10s
This commit is contained in:
27
packages/frontend/components/yale/FormSelect.vue
Normal file
27
packages/frontend/components/yale/FormSelect.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<script setup lang="ts">
|
||||
const props = defineProps<{
|
||||
options: Array<{ label: string; value: string }>,
|
||||
placeholder: string,
|
||||
modelValue: string
|
||||
}>();
|
||||
|
||||
const emit = defineEmits([
|
||||
'update:modelValue'
|
||||
]);
|
||||
|
||||
const handleSelect = (event: Event) => {
|
||||
emit('update:modelValue', (event.target as HTMLSelectElement).value);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<select class="bg-zinc-900 p-2 rounded-md" :value="props.modelValue" @change="handleSelect">
|
||||
<!-- Placeholder as the first option -->
|
||||
<option value="" disabled selected>{{ props.placeholder }}</option>
|
||||
|
||||
<!-- Render options dynamically -->
|
||||
<option v-for="option in props.options" :key="option.value" :value="option.value">
|
||||
{{ option.label }}
|
||||
</option>
|
||||
</select>
|
||||
</template>
|
Reference in New Issue
Block a user