diff --git a/packages/runtime-dom/src/directives/vModel.ts b/packages/runtime-dom/src/directives/vModel.ts index 8780b5d4..6ca363a9 100644 --- a/packages/runtime-dom/src/directives/vModel.ts +++ b/packages/runtime-dom/src/directives/vModel.ts @@ -30,16 +30,10 @@ function onCompositionEnd(e: Event) { const target = e.target as any if (target.composing) { target.composing = false - trigger(target, 'input') + target.dispatchEvent(new Event('input')) } } -function trigger(el: HTMLElement, type: string) { - const e = document.createEvent('HTMLEvents') - e.initEvent(type, true, true) - el.dispatchEvent(e) -} - type ModelDirective = ObjectDirective // We are exporting the v-model runtime directly as vnode hooks so that it can