ant-design-vue/components/_util/triggerEvent.js

9 lines
228 B
JavaScript
Raw Normal View History

2017-12-07 18:33:33 +08:00
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)
}
}