ant-design-vue/components/_util/triggerEvent.js
2017-12-07 18:33:33 +08:00

9 lines
228 B
JavaScript

export default function triggerEvent (el, type) {
if ('createEvent' in document) {
// modern browsers, IE9+
const e = document.createEvent('HTMLEvents')
e.initEvent(type, false, true)
el.dispatchEvent(e)
}
}