function tree (h, schema, rootListeners) {
  if (Array.isArray(schema)) {
    return schema.map((el, index) => {
      const item = leaf(el, index, rootListeners)
      return h(
        item.component,
        { attrs: item.attrs, class: item.class, key: item.key, on: item.on },
        item.children ? tree(h, item.children, rootListeners) : null
      )
    })
  }
  return schema
}
Recursive function to create vNodes from a schema.
@param {Functon} h createElement
@param {Array|string} schema