diff --git a/package/component/src/component/input/index.vue b/package/component/src/component/input/index.vue index 8d7e35db..58d46c87 100644 --- a/package/component/src/component/input/index.vue +++ b/package/component/src/component/input/index.vue @@ -22,9 +22,15 @@ export interface LayInputProps { modelValue?: string; placeholder?: string; allowClear?: boolean; + autofocus?: boolean; } -const props = withDefaults(defineProps(), {}); +const props = withDefaults(defineProps(), { + disabled: false, + readonly: false, + allowClear: false, + autofocus: false +}); const emit = defineEmits([ "update:modelValue", @@ -68,6 +74,7 @@ const onBlur = () => { :value="modelValue || value" :disabled="disabled" :placeholder="placeholder" + :autofocus="autofocus" :class="{ 'layui-disabled': disabled }" class="layui-input" @input="onInput" diff --git a/package/document/src/document/zh-CN/guide/changelog.md b/package/document/src/document/zh-CN/guide/changelog.md index 9bee1dc4..df744226 100644 --- a/package/document/src/document/zh-CN/guide/changelog.md +++ b/package/document/src/document/zh-CN/guide/changelog.md @@ -20,6 +20,7 @@
  • [新增] menu 组件 changeSelectedKey 事件。
  • [新增] menu 组件 childSpacing 属性, 开启菜单层级缩进。
  • [新增] slider 组件 showDots 属性, 显示步长断点。
  • +
  • [新增] input 组件 autofocus 原生属性。
  • [修复] side 组件 width 属性无效。