mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-15 04:29:37 +01:00
fix: update to fix type issues (#151)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
:autocomplete="autocomplete"
|
||||
:spellcheck="spellcheck"
|
||||
:class="inputClass"
|
||||
@input="onInput(($event.target as any).value)"
|
||||
@input="onInput"
|
||||
@focus="$emit('focus', $event)"
|
||||
@blur="$emit('blur', $event)"
|
||||
>
|
||||
@@ -147,8 +147,8 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
const onInput = (value: string) => {
|
||||
emit('update:modelValue', value)
|
||||
const onInput = (event: InputEvent) => {
|
||||
emit('update:modelValue', (event.target as any).value)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
:required="required"
|
||||
:disabled="disabled"
|
||||
:class="selectClass"
|
||||
@input="onInput(($event.target as any).value)"
|
||||
@input="onInput"
|
||||
>
|
||||
<template v-for="(option, index) in normalizedOptionsWithPlaceholder">
|
||||
<optgroup
|
||||
@@ -127,8 +127,8 @@ export default defineComponent({
|
||||
|
||||
const ui = computed<Partial<typeof appConfig.ui.select>>(() => defu({}, props.ui, appConfig.ui.select))
|
||||
|
||||
const onInput = (value: string) => {
|
||||
emit('update:modelValue', value)
|
||||
const onInput = (event: InputEvent) => {
|
||||
emit('update:modelValue', (event.target as any).value)
|
||||
}
|
||||
|
||||
const guessOptionValue = (option: any) => {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</span>
|
||||
|
||||
<slot name="label">
|
||||
<span v-if="modelValue" class="block truncate">{{ typeof modelValue === 'string' ? modelValue : (modelValue as any)[optionAttribute] }}</span>
|
||||
<span v-if="modelValue" class="block truncate">{{ typeof modelValue === 'string' ? modelValue : modelValue[optionAttribute] }}</span>
|
||||
<span v-else class="block truncate text-gray-400 dark:text-gray-500">{{ placeholder || ' ' }}</span>
|
||||
</slot>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
:placeholder="placeholder"
|
||||
:autocomplete="autocomplete"
|
||||
:class="textareaClass"
|
||||
@input="onInput(($event.target as any).value)"
|
||||
@input="onInput"
|
||||
@focus="$emit('focus', $event)"
|
||||
@blur="$emit('blur', $event)"
|
||||
/>
|
||||
@@ -128,10 +128,10 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
const onInput = (value: string) => {
|
||||
const onInput = (event: InputEvent) => {
|
||||
autoResize()
|
||||
|
||||
emit('update:modelValue', value)
|
||||
emit('update:modelValue', (event.target as any).value)
|
||||
}
|
||||
|
||||
watch(() => props.modelValue, () => {
|
||||
|
||||
Reference in New Issue
Block a user