/**
* 获取事件冒泡路径,兼容 IE11,Edge,Chrome,Firefox,Safari
* 目前使用的地方:JVxeTable Span模式
*/
export function getEventPath(event) {
let target = event.target
let path = (event.composedPath && event.composedPath()) || event.path

if (path != null) {
return (path.indexOf(window) < 0) ? path.concat(window) : path
}

if (target === window) {
return [window]
}

let getParents = (node, memo) => {
const parentNode = node.parentNode

if (!parentNode) {
return memo
} else {
return getParents(parentNode, memo.concat(parentNode))
}
}
return [target].concat(getParents(target, []), window)
}