Added search box
This commit is contained in:
@@ -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>
|
||||
|
||||
Vendored
+2
-1
@@ -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' {
|
||||
|
||||
Reference in New Issue
Block a user