From 8ef2ab160eeb11cd88f1fb06e0ec1dcf07660325 Mon Sep 17 00:00:00 2001 From: shenjunjian <40288193@qq.com> Date: Thu, 5 Dec 2024 00:23:39 -0800 Subject: [PATCH] fix(input): fix input's autofocus not work --- packages/renderless/src/input/vue.ts | 4 ++++ packages/vue/src/tree/src/tree-node.vue | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/renderless/src/input/vue.ts b/packages/renderless/src/input/vue.ts index 082c5d5ce2..0db2a8e023 100644 --- a/packages/renderless/src/input/vue.ts +++ b/packages/renderless/src/input/vue.ts @@ -416,6 +416,10 @@ export const renderless = ( api.setShowMoreBtn(true) on(window, 'resize', api.setShowMoreBtn) } + + if (vm.$attrs.autofocus) { + api.focus() + } }) onBeforeUnmount(() => { diff --git a/packages/vue/src/tree/src/tree-node.vue b/packages/vue/src/tree/src/tree-node.vue index 758450ff59..12f1f275a1 100644 --- a/packages/vue/src/tree/src/tree-node.vue +++ b/packages/vue/src/tree/src/tree-node.vue @@ -121,7 +121,7 @@