Subscribe on changes!

v-model document.createEvents are deprecated

avatar
Apr 15th 2022

What problem does this feature solve?

use CustomEvent instead of document.createEvent

What does the proposed API look like?

src/platforms/web/runtime/directives/model.js

trigger function function trigger(el, type) { if (window.CustomEvent !== undefined) { const e = new CustomEvent(type); el.dispatchEvent(event); } else { const e = document.createEvent("HTMLEvents"); e.initEvent(type, true, true); el.dispatchEvent(e); } }

avatar
Apr 15th 2022

That's not that straightforward. a CustomEvent isn't a drop-in replacement for an HTMLEvent, it has a different interface.