refactor: type Input's events
This commit is contained in:
parent
197a862f3f
commit
d0d92de2b6
1 changed files with 6 additions and 2 deletions
|
@ -2,12 +2,16 @@
|
|||
import { createEventDispatcher } from 'svelte';
|
||||
let input: HTMLInputElement;
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
const dispatch = createEventDispatcher<{
|
||||
focusChange: boolean;
|
||||
input: string;
|
||||
}>();
|
||||
|
||||
export let placeholder = '';
|
||||
export let value = '';
|
||||
export let disabled = false;
|
||||
export let size: number | undefined = 7;
|
||||
export let klass = '';
|
||||
|
||||
let focused = false;
|
||||
$: dispatch('focusChange', focused);
|
||||
|
@ -21,7 +25,7 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<div class="input" class:focused>
|
||||
<div class="input {klass}" class:focused>
|
||||
<slot name="prefix" />
|
||||
<input
|
||||
bind:this={input}
|
||||
|
|
Loading…
Reference in a new issue