ant-design-vue/components/_util/Dom/contains.js

12 lines
175 B
JavaScript
Raw Normal View History

2017-12-22 10:43:28 +00:00
export default function contains (root, n) {
let node = n
while (node) {
if (node === root) {
return true
}
node = node.parentNode
}
return false
}