261a2dafb56897da2ba5bd962d6865daccd46456e75efcced80fed05df175cc1d625de252b20537d27315c8b7461f2027a8cdc5ce7cb1a39f4ccb17476911f 409 B

123456789101112131415
  1. /* @flow */
  2. import { isDef } from 'shared/util'
  3. import { isAsyncPlaceholder } from './is-async-placeholder'
  4. export function getFirstComponentChild (children: ?Array<VNode>): ?VNode {
  5. if (Array.isArray(children)) {
  6. for (let i = 0; i < children.length; i++) {
  7. const c = children[i]
  8. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  9. return c
  10. }
  11. }
  12. }
  13. }