From 11bb97ca96bcd8fb7b4a431e95ed3f563730a9cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Sat, 11 Jun 2022 00:15:54 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(input):=20typescript=20=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新文档 --- package/component/src/component/input/index.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/package/component/src/component/input/index.vue b/package/component/src/component/input/index.vue index 90b78cc3..bddad0a6 100644 --- a/package/component/src/component/input/index.vue +++ b/package/component/src/component/input/index.vue @@ -10,21 +10,17 @@ import { LayIcon } from "@layui/icons-vue"; import { computed, useSlots } from "vue"; import { useI18n } from "../../language"; -const { t } = useI18n(); -const slots = useSlots(); -const hasContent = computed(() => props.modelValue?.length > 0); - export interface LayInputProps { name?: string; type?: string; value?: string; disabled?: boolean; readonly?: boolean; - modelValue?: string; + modelValue: string; placeholder?: string; allowClear?: boolean; autofocus?: boolean; - autocomplete?: boolean; + autocomplete?: string; } const props = withDefaults(defineProps(), { @@ -32,7 +28,6 @@ const props = withDefaults(defineProps(), { readonly: false, allowClear: false, autofocus: false, - autocomplete: false, }); const emit = defineEmits([ @@ -44,6 +39,10 @@ const emit = defineEmits([ "blur", ]); +const { t } = useI18n(); +const slots = useSlots(); +const hasContent = computed(() => props.modelValue?.length > 0); + const onInput = function (event: Event) { const inputElement = event.target as HTMLInputElement; const value = inputElement.value;