budibase/packages/standard-components/src/Select.svelte

28 lines
465 B
Svelte
Raw Normal View History

<script>
export let value="";
2020-01-18 10:00:18 +01:00
export let className = "";
export let type = "text";
export let options = [];
export let _bb;
let actualValue = "";
const onchange = (ev) => {
if(_bb) {
2019-10-19 08:24:20 +02:00
_bb.setStateFromBinding(_bb.props.value, ev.target.value);
}
}
</script>
<select class={className}
value={value}
on:change={onchange}>
<option></option>
{#each options as opt}
<option id={opt.id ? opt.id : opt.value}>{opt.value}</option>
{/each}
</select>