// 获取当前位置
function getIndex(activeOption, list) {
  if (!(activeOption !== null && activeOption !== void 0 && activeOption.id) || !Array.isArray(list) || !list.length) return 0;
  var activeIndex = list.findIndex(function (item) {
    return item.id === activeOption.id;
  });
  // 未找到匹配项, 默认选中第一项
  return activeIndex <= 0 ? 0 : activeIndex;
}
export default getIndex;