Browse Source

🐞 fix: 修复邮箱自动补全失效的问题

Pchen. 3 weeks ago
parent
commit
85ee19edb2
1 changed files with 2 additions and 6 deletions
  1. 2 6
      src/plugins/trimInput.js

+ 2 - 6
src/plugins/trimInput.js

@@ -8,11 +8,6 @@ function shouldTrim(props, noTrim) {
 }
 
 export function withInputTrim(Original) {
-  const originalEmits =
-    typeof Original.emits === 'object' && Original.emits !== null
-      ? Object.keys(Original.emits)
-      : ['update:modelValue', 'input', 'change', 'pressEnter', 'clear', 'focus', 'blur']
-
   return defineComponent({
     name: `Trim${Original.name || 'Input'}`,
     inheritAttrs: false,
@@ -23,7 +18,8 @@ export function withInputTrim(Original) {
         default: false,
       },
     },
-    emits: [...new Set([...originalEmits, 'update:modelValue'])],
+    // 仅声明包装层自行处理的事件;其余(如 AutoComplete 的 search)留在 attrs 中透传
+    emits: ['update:modelValue', 'blur'],
     setup(props, { attrs, slots, emit }) {
       return () => {
         const { noTrim, modelValue, ...rest } = props