🌌 Migrate app to svelte-5
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
<script lang="ts">
|
||||
export let options: string[] = [];
|
||||
export let selectedOption: string = '';
|
||||
import { createBubbler } from 'svelte/legacy';
|
||||
|
||||
const bubble = createBubbler();
|
||||
interface Props {
|
||||
options?: string[];
|
||||
selectedOption?: string;
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
let { options = [], selectedOption = $bindable(''), ...rest }: Props = $props();
|
||||
</script>
|
||||
|
||||
<select
|
||||
bind:value={selectedOption}
|
||||
on:change
|
||||
class="select select-bordered select-sm lg:select-md max-w-xs {$$restProps.class || ''}"
|
||||
onchange={bubble('change')}
|
||||
class="select select-bordered select-sm lg:select-md max-w-xs {rest.class || ''}"
|
||||
>
|
||||
{#each options as option}
|
||||
<option value={option}>{option}</option>
|
||||
|
||||
Reference in New Issue
Block a user