Added search box

This commit is contained in:
2026-04-04 09:50:11 +10:00
parent 877caa3291
commit bfe246ab44
4 changed files with 10 additions and 3 deletions
@@ -1,12 +1,16 @@
<script setup lang="ts">
import { ref, nextTick } from 'vue'
import axios from 'axios'
import {usePage} from "@inertiajs/vue3";
import type {SharedProps} from "@/Types/types";
const props = defineProps<{
prefilledOptions: { value: number, title: string }[]
errorMessages?: string[] | string
}>()
const page = usePage<SharedProps>().props
const model = defineModel<{ value: number, title: string } | null>()
const airlineOptions = ref(props.prefilledOptions ?? [])
@@ -54,13 +58,13 @@ const searchAirlines = async (query: string) => {
style="padding: 0.25em"
width="40"
height="40"
:src="`http://api.flightsgoneby.test:8000/airlines/logos/tail/id/${model.value}`"
:src="`${page.logo_api_url}/airlines/logos/tail/id/${model.value}`"
/>
</template>
<template #item="{ item, props: itemProps }">
<v-list-item v-bind="itemProps">
<template #prepend>
<img style="padding:0.25em" width="40" height="40" :src="`http://api.flightsgoneby.test:8000/airlines/logos/tail/id/${item.value}`" />
<img style="padding:0.25em" width="40" height="40" :src="`${page.logo_api_url}/airlines/logos/tail/id/${item.value}`" />
</template>
</v-list-item>
+2 -1
View File
@@ -19,7 +19,8 @@ export type SharedProps = import('@inertiajs/core').PageProps & {
auth: {
user: User | null
isLoggedIn: boolean
}
},
logo_api_url: string
}
declare module '@inertiajs/vue3' {