vdom.js 739 B

1234567891011121314151617181920
  1. 'use strict';
  2. exports.__esModule = true;
  3. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  4. exports.isVNode = isVNode;
  5. exports.getFirstComponentChild = getFirstComponentChild;
  6. var _util = require('element-ui/lib/utils/util');
  7. function isVNode(node) {
  8. return (typeof node === 'undefined' ? 'undefined' : _typeof(node)) === 'object' && (0, _util.hasOwn)(node, 'componentOptions');
  9. };
  10. function getFirstComponentChild(children) {
  11. return children && children.filter(function (c) {
  12. return c && c.tag;
  13. })[0];
  14. };