function findAllParentInstances(childVm) {
  var instances = [childVm];

  function getParent(_vm) {
    if (_vm && _vm.$parent) {
      instances.push(_vm.$parent);
      return getParent(_vm.$parent)
    }
    return _vm
  }

  getParent(childVm);
  return instances
}
Traverses a vue instance for its parents and returns them in an array format
@param {Component} vm
@returns {Component[]} The component and its corresponding parents, in order from left to right