v-model document.createEvents are deprecated
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); } }
That's not that straightforward. a CustomEvent isn't a drop-in replacement for an HTMLEvent, it has a different interface.
To add on to what @LinusBorg is saying check out: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent https://developer.mozilla.org/en-US/docs/web/api/event
🙂