A
Size: a a a
A
AP
A
<script lang="ts">
export let value: string | number = '';
export let type = 'text';
function handleInput(event: InputEvent): void {
const { value: inputVal } = event.target as HTMLInputElement;
value = type === 'number' ? +inputVal : inputVal;
}
</script>
<input {type} {value} on:input={handleInput} on:input />
^ошибка тут
DK
<script lang="ts">
export let value: string | number = '';
export let type = 'text';
function handleInput(event: InputEvent): void {
const { value: inputVal } = event.target as HTMLInputElement;
value = type === 'number' ? +inputVal : inputVal;
}
</script>
<input {type} {value} on:input={handleInput} on:input />
^ошибка тут
const onInput: svelte.JSX.EventHandler<KeyboardEvent, HTMLInputElement> = e => {}
DK
КС
DK
event.key
или event.code
тебе будут недоступны.AP
AP
DK
currentTarget
тоже не обратишься.КС
DK
const onInput: svelte.JSX.EventHandler<KeyboardEvent, HTMLInputElement> = e => {}
AP
DK
AP
AP
КС
КС
DK
U