element/src/utils/vdom.js

10 lines
272 B
JavaScript
Raw Normal View History

2017-02-28 05:09:31 +00:00
import { hasOwn } from 'element-ui/src/utils/util';
2017-01-04 07:52:35 +00:00
export function isVNode(node) {
2017-02-28 05:09:31 +00:00
return typeof node === 'object' && hasOwn(node, 'componentOptions');
};
export function getFirstComponentChild(children) {
return children && children.filter(c => c && c.tag)[0];
2017-01-04 07:52:35 +00:00
};