mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-24 12:35:31 +00:00
32 lines
No EOL
876 B
Svelte
32 lines
No EOL
876 B
Svelte
<script lang="ts">
|
|
import type { School } from '$lib/stores/candidate';
|
|
import AutoComplete from 'simple-svelte-autocomplete';
|
|
import { onMount } from 'svelte';
|
|
// import schoollistString from '$lib/assets/schoollist.txt';
|
|
|
|
let schools: string[] = [];
|
|
|
|
onMount(async () => {
|
|
schools = await fetch('/schoollist.txt')
|
|
.then((response) => response.text())
|
|
.then((text) => text.split(';'));
|
|
});
|
|
|
|
export let selectedSchool: School;
|
|
export let schoolName: string = selectedSchool.name;
|
|
$: selectedSchool.name = schoolName;
|
|
|
|
</script>
|
|
|
|
<div class="flex flex-row">
|
|
<div>
|
|
<span>
|
|
Selected school: {selectedSchool.name}
|
|
</span>
|
|
<AutoComplete items={schools} bind:selectedItem={schoolName} />
|
|
</div>
|
|
<div class="flex">
|
|
<span>Obor: </span>
|
|
<input type="text" bind:value={selectedSchool.field} />
|
|
</div>
|
|
</div> |