import NavHeader from "@/components/nav-header/components/NavHeader.vue";
import MyApps from "@/components/my-apps/components/MyApps.vue";
import UserInfo from "@/components/user-info/components/UserInfo.vue";
import LeftMenu from "@/components/left-menu/components/LeftMenu.vue";
import Vue from "vue";
import { InstallationOptions } from "element-ui/types/element-ui";

const components: any = {
  NavHeader: NavHeader,
  MyApps: MyApps,
  UserInfo: UserInfo,
  LeftMenu: LeftMenu
};

const install: any = function(vue: typeof Vue, options: InstallationOptions) {
  if (install.installed) return;
  install.installed = true;

  Object.keys(components).forEach(key => {
    Vue.component(key, components[key]);
  });

  Vue.prototype.$ec = {};
};

const VueEc: any = {
  version: process.env.VERSION,
  install
};
export { VueEc };
export * from "./components/index";
